Merge branch 'master' into LouDi_Quan
This commit is contained in:
commit
50a400d125
@ -24,6 +24,7 @@ namespace QFramework
|
|||||||
string deviceName;
|
string deviceName;
|
||||||
string matName;
|
string matName;
|
||||||
string index;
|
string index;
|
||||||
|
string mainTexture;
|
||||||
public static MatAction Allocate(Dictionary<string, string> datas, System.Action OnFinished = null)
|
public static MatAction Allocate(Dictionary<string, string> datas, System.Action OnFinished = null)
|
||||||
{
|
{
|
||||||
var retNode = mPool.Allocate();
|
var retNode = mPool.Allocate();
|
||||||
@ -34,6 +35,7 @@ namespace QFramework
|
|||||||
retNode.deviceName = datas.ContainsKey("deviceName") ? datas["deviceName"] : "";
|
retNode.deviceName = datas.ContainsKey("deviceName") ? datas["deviceName"] : "";
|
||||||
retNode.matName = datas.ContainsKey("matName") ? datas["matName"] : "";
|
retNode.matName = datas.ContainsKey("matName") ? datas["matName"] : "";
|
||||||
retNode.index = datas.ContainsKey("index") ? datas["index"] : "0";
|
retNode.index = datas.ContainsKey("index") ? datas["index"] : "0";
|
||||||
|
retNode.mainTexture = datas.ContainsKey("mainTexture") ? datas["mainTexture"] : null;
|
||||||
retNode.OnFinished = OnFinished;
|
retNode.OnFinished = OnFinished;
|
||||||
return retNode;
|
return retNode;
|
||||||
}
|
}
|
||||||
@ -56,7 +58,22 @@ namespace QFramework
|
|||||||
var mesh = obj.GetComponent<Renderer>();
|
var mesh = obj.GetComponent<Renderer>();
|
||||||
int matIndex = 0;
|
int matIndex = 0;
|
||||||
int.TryParse(index, out matIndex);
|
int.TryParse(index, out matIndex);
|
||||||
mesh.materials[matIndex] = Resources.Load<Material>("Mat/" + matName);
|
if (string.IsNullOrEmpty(matName) == false)
|
||||||
|
{
|
||||||
|
mesh.materials[matIndex] = Resources.Load<Material>("Mat/" + matName);
|
||||||
|
}
|
||||||
|
if (mainTexture != null)
|
||||||
|
{
|
||||||
|
if (mainTexture == "")
|
||||||
|
{
|
||||||
|
mesh.materials[matIndex].mainTexture = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mesh.materials[matIndex].mainTexture = Resources.Load<Texture>("Mat/" + mainTexture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.Finish();
|
this.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1122,6 +1122,11 @@ namespace XMLTool
|
|||||||
{
|
{
|
||||||
act.args.Add("index", index.Value);
|
act.args.Add("index", index.Value);
|
||||||
}
|
}
|
||||||
|
XAttribute mainTexture = action.Attribute("mainTexture");
|
||||||
|
if (mainTexture != null)
|
||||||
|
{
|
||||||
|
act.args.Add("mainTexture", mainTexture.Value);
|
||||||
|
}
|
||||||
newAction = act;
|
newAction = act;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -162,7 +162,8 @@
|
|||||||
<!--弹窗 btns可支持多个按钮-->
|
<!--弹窗 btns可支持多个按钮-->
|
||||||
<Action type="TipWindow" value="恭喜你完成当前模块" btns="确定,取消" audio=""></Action>
|
<Action type="TipWindow" value="恭喜你完成当前模块" btns="确定,取消" audio=""></Action>
|
||||||
|
|
||||||
|
<!--动态更换材质球和主贴图 材质球优先级高于贴图 同时写的情况下 先换材质球再换贴图-->
|
||||||
|
<Action type="Mat" value="Models/zhudao/nan_shoushufu.012" matName="yiyongshoutao_yellow1" index="1" mainTexture="贴图名字"></Action>
|
||||||
|
|
||||||
<!--预加载模块 要在app.xml的Data标签内-->
|
<!--预加载模块 要在app.xml的Data标签内-->
|
||||||
<PreLoad>
|
<PreLoad>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user