Beispiel #1
0
        public void Open(Action execOK)
        {
            string panelPath = "Prefabs/UI/LoadingPanel";
            var    prefab    = resMgr.LoadResAsset <GameObject>(panelPath);

            if (prefab != null)
            {
                var parent = GameObject.FindWithTag("UICanvas");
                gameObject      = Instantiate <GameObject>(prefab);
                gameObject.name = "LoadingPanel";
                gameObject.transform.SetParent(parent.transform);
                gameObject.transform.localPosition = Vector3.zero;
                gameObject.transform.localScale    = Vector3.one;

                mPrefabVar        = gameObject.GetComponent <CPrefabVar>();
                txt_status        = mPrefabVar.GetVar <Text>("txt_status", VarType.Text);
                slider_loadingBar = mPrefabVar.GetVar <Slider>("slider_loadingBar", VarType.Slider);
                if (execOK != null)
                {
                    execOK();
                }
            }
        }
 void OnEnable()
 {
     mPrefabVar = target as CPrefabVar;
     mReordList = this.CreateItemList();
 }