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