private CMD GetParentDialog(bool open) { float num = 100000f; CMD cmd = null; Dictionary <string, CommonDialog> dialogDic = GUIManager.GetDialogDic(); foreach (string key in dialogDic.Keys) { GameObject gameObject = dialogDic[key].gameObject; if (gameObject.transform.localPosition.z < num && this != dialogDic[key]) { CMD cmd2 = (CMD)dialogDic[key]; if (null != cmd2 && cmd2.useCMDAnim && cmd2.GetActionStatus() == CommonDialog.ACT_STATUS.OPEN && !this.DontLookParent) { num = gameObject.transform.localPosition.z; if (!cmd2.HideFromChild) { cmd = cmd2; } else { cmd = null; } } } } if (!(null != cmd) || !cmd.useCMDAnim) { return(null); } if (open) { return(cmd); } float z = base.GetOriginalPos().z; float z2 = cmd.GetOriginalPos().z; if (z2 > z) { return(cmd); } return(null); }