扩展功能 show 支持root
This commit is contained in:
parent
4e33c3b66f
commit
cc1f9e7498
@ -20,6 +20,7 @@ public class ShowAction : IAction
|
||||
string isShow = string.Empty;
|
||||
string deviceName = string.Empty;
|
||||
string isDevice = string.Empty;
|
||||
string isRoot = string.Empty;
|
||||
public static ShowAction Allocate(string path, Dictionary<string, string> datas, System.Action onDelayFinish = null)
|
||||
{
|
||||
var retNode = mPool.Allocate();
|
||||
@ -30,6 +31,7 @@ public class ShowAction : IAction
|
||||
retNode.isShow = datas.ContainsKey("isShow") ? datas["isShow"] : string.Empty;
|
||||
retNode.deviceName = datas.ContainsKey("deviceName") ? datas["deviceName"] : string.Empty;
|
||||
retNode.isDevice = datas.ContainsKey("isDevice") ? datas["isDevice"] : string.Empty;
|
||||
retNode.isRoot = datas.ContainsKey("isRoot") ? datas["isRoot"] : null;
|
||||
return retNode;
|
||||
}
|
||||
|
||||
@ -79,7 +81,17 @@ public class ShowAction : IAction
|
||||
{
|
||||
bool isActive = true;
|
||||
bool.TryParse(isShow, out isActive);
|
||||
obj.SetActive(isActive);
|
||||
if (string.IsNullOrEmpty(isRoot))
|
||||
{
|
||||
obj.SetActive(isActive);
|
||||
}
|
||||
else if (isRoot == "true")
|
||||
{
|
||||
for (int i = 0; i < obj.transform.childCount; i++)
|
||||
{
|
||||
obj.transform.GetChild(i).gameObject.SetActive(isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Finish();
|
||||
|
||||
|
||||
@ -593,6 +593,11 @@ namespace XMLTool
|
||||
{
|
||||
act.args.Add("deviceName", deviceName.Value);
|
||||
}
|
||||
XAttribute isRoot = action.Attribute("isRoot");
|
||||
if (isRoot != null)
|
||||
{
|
||||
act.args.Add("isRoot", isRoot.Value);
|
||||
}
|
||||
newAction = act;
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user