|
|
@ -459,16 +459,20 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { |
|
|
|
public void setParam(String name, VarType type, Object value) { |
|
|
|
public void setParam(String name, VarType type, Object value) { |
|
|
|
checkSetParam(type, name); |
|
|
|
checkSetParam(type, name); |
|
|
|
|
|
|
|
|
|
|
|
MatParam val = getParam(name); |
|
|
|
if (type.isTextureType()) { |
|
|
|
if (val == null) { |
|
|
|
setTextureParam(name, type, (Texture)value); |
|
|
|
MatParam paramDef = def.getMaterialParam(name); |
|
|
|
|
|
|
|
paramValues.put(name, new MatParam(type, name, value, paramDef.getFixedFuncBinding())); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
val.setValue(value); |
|
|
|
MatParam val = getParam(name); |
|
|
|
} |
|
|
|
if (val == null) { |
|
|
|
|
|
|
|
MatParam paramDef = def.getMaterialParam(name); |
|
|
|
if (technique != null) { |
|
|
|
paramValues.put(name, new MatParam(type, name, value, paramDef.getFixedFuncBinding())); |
|
|
|
technique.notifyParamChanged(name, type, value); |
|
|
|
} else { |
|
|
|
|
|
|
|
val.setValue(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (technique != null) { |
|
|
|
|
|
|
|
technique.notifyParamChanged(name, type, value); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|