Esempio n. 1
0
    /// <summary>
    /// Panel 開/關狀態
    /// </summary>
    /// <param name="panelNo">Panel編號</param>
    private void PanelSwitch()
    {
        PanelState panelState = dictPanelRefs[_panelName];      // 取得目前Panel狀態

        if (panelState.obj != null)
        {
            if (!panelState.obj.activeSelf)                     // 如果Panel是關閉狀態
            {
                if (_lastPanel != null)
                {
                    _lastPanel.SetActive(false);
                }
                panelState.obj.SetActive(true);
                panelState.obj.transform.GetChild(0).SendMessage("OnLoading");
                panelState.onOff = !panelState.onOff;
                _lastPanel       = panelState.obj;

                EventMaskSwitch.Switch(panelState.obj);
                EventMaskSwitch.lastPanel = panelState.obj;
            }                                                   // 如果Panel已開啟
            else
            {
                panelState.obj.SetActive(false);
                panelState.onOff = !panelState.onOff;
                Camera.main.GetComponent <UICamera>().eventReceiverMask = (int)Global.UILayer.Default;
            }
        }
        else
        {
            Debug.LogError("PanelNo is unknow!");
        }
    }
Esempio n. 2
0
 public void OnBuyClick(GameObject myPanel)
 {
     myPanel.SetActive(false);
     infoGroupsArea[5].SetActive(true);
     BuyWindowsInit();
     LoadBuyCountInfo(_lastItem, infoGroupsArea[5].transform);
     EventMaskSwitch.Switch(infoGroupsArea[5]);
 }
Esempio n. 3
0
    void OnMessage()
    {
        Debug.Log("HERER");
        Debug.Log(messageBox.name);
        messagePanel.SetActive(true);
        messageBox.GetComponentInChildren <UILabel>().text = "Complete !";

        EventMaskSwitch.Switch(messagePanel);
    }
Esempio n. 4
0
    private void InstantiatePanel() //實體化Panel現在是正確的,有時間可以重新啟用 很多用編輯器拉進去的Panel都要修改到陣列
    {
        PanelState panelState = new PanelState();
        GameObject bundle     = assetLoader.GetAsset(_panelName);

        panelState.obj       = insObj.Instantiate(bundle, Panel[_panelNo].transform, _panelName, Vector3.zero, Vector3.one, Vector3.zero, -1);
        panelState.obj       = panelState.obj.transform.parent.gameObject;
        panelState.obj.layer = Panel[_panelNo].layer;
        dictPanelRefs.Add(_panelName, panelState);
        EventMaskSwitch.Switch(panelState.obj);
    }
Esempio n. 5
0
    public void OnClosed(GameObject obj)
    {
        EventMaskSwitch.lastPanel = null;
        GameObject root = obj.transform.parent.parent.gameObject;

        _tmpTab.SetActive(false);
        infoGroupsArea[2].SetActive(true);
        _tmpTab = infoGroupsArea[2];

        GameObject.FindGameObjectWithTag("GM").GetComponent <PanelManager>().LoadPanel(obj.transform.parent.gameObject);
        EventMaskSwitch.Switch(root);
    }
Esempio n. 6
0
    public void OnItemClick(GameObject obj)
    {
        int itemType = int.Parse(obj.GetComponent <Item>().storeInfo[(int)StoreProperty.ItemType]);

        _lastItem = obj;

        buyingGoodsData[0] = obj.GetComponent <Item>().storeInfo[(int)StoreProperty.ItemID];
        buyingGoodsData[1] = obj.GetComponent <Item>().storeInfo[(int)StoreProperty.ItemName];
        buyingGoodsData[2] = obj.GetComponent <Item>().storeInfo[(int)StoreProperty.ItemType];

        LoadProperty loadProperty = new LoadProperty();

        loadProperty.LoadMiceProperty(obj, infoGroupsArea[4].transform.GetChild(0).gameObject, 0);
        loadProperty.LoadPrice(obj, infoGroupsArea[4].transform.GetChild(0).gameObject, itemType);

        _bLoadedActor = LoadActor(obj, infoGroupsArea[4].transform.GetChild(0).GetChild(0), actorScale);   // 錯誤 暫時道具沒有動畫物件

        infoGroupsArea[4].SetActive(true);
        EventMaskSwitch.Switch(infoGroupsArea[4]);
    }
Esempio n. 7
0
 public void  OnClosed()
 {
     EventMaskSwitch.openedPanel.SetActive(false);
     EventMaskSwitch.Switch(EventMaskSwitch.lastPanel);
 }
Esempio n. 8
0
 public void OnReturn(GameObject obj)
 {
     EventMaskSwitch.openedPanel.SetActive(false);
     EventMaskSwitch.Switch(obj);
 }