Exemple #1
0
    static public bool CheckData(FUniversalPanel fp, string keyName)
    {
        Transform[]      ts     = fp.gameObject.transform.GetComponentsInChildren <Transform>(true);
        List <Transform> tempTf = new List <Transform>();

        for (int i = 0; i < ts.Length; i++)
        {
            if (ts[i].gameObject.name.Length > keyName.Length)
            {
                if (ts[i].gameObject.name.Substring(0, keyName.Length) == keyName)
                {
                    tempTf.Add(ts[i]);
                }
            }
        }


        if (fp.mValue.Count == tempTf.Count)
        {
            for (int i = 0; i < tempTf.Count; ++i)
            {
                if (!fp.mValue.Contains(tempTf[i].gameObject))
                {
                    return(false);
                }
            }
            return(true);
        }
        return(false);
    }
Exemple #2
0
        public static FUniversalPanel ChangeUniversal(this GameObject thisGo, string keyName = "F_")
        {
            FUniversalPanel fp = SceneManager.instance.AddComponent <FUniversalPanel>(thisGo);

            fp.mKey = keyName;
            fp.ApplyData();
            return(fp);
        }
Exemple #3
0
        protected override void Init()
        {
            base.Init();
            //MirrorFlipCamera(GetMianCamera());
            FUniversalPanel main   = this.GetComponent <FUniversalPanel>();
            var             canvas = main.GetFObject <UnityEngine.UI.CanvasScaler>("F_Canvas");

            canvas.matchWidthOrHeight = 0;
        }
Exemple #4
0
 // 添加UniversalPanel组件的GameObject被选中时触发该函数
 void OnEnable()
 {
     np           = target as FUniversalPanel;
     KeyStr       = np.mKey;
     isUpdateShow = !CheckData(np, KeyStr);
     if (isUpdateShow)
     {
         if (!Application.isPlaying)
         {
             applyData();
         }
     }
     //applyData();
     mSelectPrefab = new SelectPrefabEditor("");
 }
Exemple #5
0
 public override bool Init()
 {
     m_msgMesh   = new MsgMesh();
     m_ShowEnter = true;
     m_main      = GetComponent <FUniversalPanel>();
     if (m_main != null)
     {
         m_slider     = m_main.GetFObject <Slider>("F_Slider");
         m_enterPanel = m_main.GetFObject("F_EnterPlane");
         m_loadPanel  = m_main.GetFObject("F_LoadPlane");
         m_enterText  = m_main.GetFObject <Text>("F_Title");
         m_enterPanel.SetActive(false);
         m_loadPanel.SetActive(true);
         m_gameType = GameType.GT_NONE;
         if (mMainPlane == null)
         {
             m_loading = new LoadPercent();
             m_loading.SetTimece(1);
             m_loading.GoOn(1);
         }
         else
         {
             m_loading = mMainPlane.mLoadPercent;
         }
         m_msgMesh.RegEvent(EventStrArray.KeyCodeEvent.KEYCODE_ENTER_DOWN, (f) =>
         {
             FEngine.IsInit = true;
             BeginLoadScene();
             //      EventListenManager.Send(EventStrArray.PlayerCtrlEvent.ENTER_GAME);
         });
     }
     else
     {
         Debug.Log("this == null");
     }
     return(base.Init());
 }