C# Class CryEngine.Material

Represents a CryENGINE material applicable to any ingame object or entity.
显示文件 Open project: PoppermostProductions/CryMono Class Usage Examples

Private Properties

Property Type Description
Material System
Material System
TryGet Material

Public Methods

Method Description
Clone ( int subMaterial = -1 ) : Material

Clones a material

Create ( string name, bool makeIfNotFound = true, bool nonRemovable = false ) : Material
Equals ( object obj ) : bool
Find ( string name ) : Material
Get ( EntityBase entity, int slot ) : Material
GetHashCode ( ) : int
GetParam ( string paramName ) : float

Gets a material's parameter value by name.

GetParamColor ( string paramName ) : Color

Gets a material's parameter value by name.

GetShaderParamName ( int index ) : string

Gets a shader parameter name by index. See ShaderParamCount

GetSubmaterial ( int slot ) : Material

Gets a submaterial by slot.

Load ( string name, bool makeIfNotFound = true, bool nonRemovable = false ) : Material
Set ( EntityBase entity, Material mat, int slot ) : void
SetParam ( string paramName, Color value ) : bool

Sets a material parameter value by name.

SetParam ( string paramName, float value ) : bool

Sets a material parameter value by name.

SetShaderParam ( ShaderColorParameter param, Color value ) : void

Sets a shader parameter value by name.

SetShaderParam ( ShaderColorParameter param, Vec3 value ) : void

Sets a shader parameter value by name.

SetShaderParam ( ShaderFloatParameter param, float value ) : void

Sets a shader parameter value by name.

SetShaderParam ( string paramName, Color newVal ) : void

Sets a shader parameter value by name.

SetShaderParam ( string paramName, float newVal ) : void

Sets a shader parameter value by name.

TryGetParam ( string paramName, Color &value ) : bool

Attempts to get parameter value by name.

TryGetParam ( string paramName, float &value ) : bool

Attempts to get parameter value by name.

Private Methods

Method Description
Material ( ) : System
Material ( IntPtr ptr ) : System
TryGet ( IntPtr ptr ) : Material

Method Details

Clone() public method

Clones a material
public Clone ( int subMaterial = -1 ) : Material
subMaterial int If negative, all sub materials are cloned, otherwise only the specified slot is
return Material

Create() public static method

public static Create ( string name, bool makeIfNotFound = true, bool nonRemovable = false ) : Material
name string
makeIfNotFound bool
nonRemovable bool
return Material

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

Find() public static method

public static Find ( string name ) : Material
name string
return Material

Get() public static method

public static Get ( EntityBase entity, int slot ) : Material
entity EntityBase
slot int
return Material

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetParam() public method

Gets a material's parameter value by name.
public GetParam ( string paramName ) : float
paramName string
return float

GetParamColor() public method

Gets a material's parameter value by name.
public GetParamColor ( string paramName ) : Color
paramName string
return Color

GetShaderParamName() public method

Gets a shader parameter name by index. See ShaderParamCount
public GetShaderParamName ( int index ) : string
index int
return string

GetSubmaterial() public method

Gets a submaterial by slot.
public GetSubmaterial ( int slot ) : Material
slot int
return Material

Load() public static method

public static Load ( string name, bool makeIfNotFound = true, bool nonRemovable = false ) : Material
name string
makeIfNotFound bool
nonRemovable bool
return Material

Set() public static method

public static Set ( EntityBase entity, Material mat, int slot ) : void
entity EntityBase
mat Material
slot int
return void

SetParam() public method

Sets a material parameter value by name.
public SetParam ( string paramName, Color value ) : bool
paramName string
value Color
return bool

SetParam() public method

Sets a material parameter value by name.
public SetParam ( string paramName, float value ) : bool
paramName string
value float
return bool

SetShaderParam() public method

Sets a shader parameter value by name.
public SetShaderParam ( ShaderColorParameter param, Color value ) : void
param ShaderColorParameter
value Color
return void

SetShaderParam() public method

Sets a shader parameter value by name.
public SetShaderParam ( ShaderColorParameter param, Vec3 value ) : void
param ShaderColorParameter
value Vec3
return void

SetShaderParam() public method

Sets a shader parameter value by name.
public SetShaderParam ( ShaderFloatParameter param, float value ) : void
param ShaderFloatParameter
value float
return void

SetShaderParam() public method

Sets a shader parameter value by name.
public SetShaderParam ( string paramName, Color newVal ) : void
paramName string
newVal Color
return void

SetShaderParam() public method

Sets a shader parameter value by name.
public SetShaderParam ( string paramName, float newVal ) : void
paramName string
newVal float
return void

TryGetParam() public method

Attempts to get parameter value by name.
public TryGetParam ( string paramName, Color &value ) : bool
paramName string
value Color
return bool

TryGetParam() public method

Attempts to get parameter value by name.
public TryGetParam ( string paramName, float &value ) : bool
paramName string
value float
return bool