public static GameObject GetBindBelongs2GameObject(Bind bind) { var trans = bind.Transform; while (trans.parent != null) { if (trans.parent.GetComponent <ViewController>()) { return(trans.parent.gameObject); } if (trans.parent.GetComponent <UIPanel>()) { return(trans.parent.gameObject); } trans = trans.parent; } return(bind.gameObject); }
public static string GetBindBelongs2(Bind bind) { var trans = bind.Transform; while (trans.parent != null) { if (trans.parent.GetComponent <ViewController>()) { return(trans.parent.name + "(" + trans.parent.GetComponent <ViewController>().ScriptName + ")"); } if (trans.parent.GetComponent <UIPanel>()) { return("UIPanel" + "(" + trans.parent.GetComponent <UIPanel>().name + ")"); } trans = trans.parent; } return(trans.name); }