예제 #1
0
    public void InitFinalLevel(UILevelSelectItem[] items) {
        mIsFinalLevel = true;

        //check if all levels are completed
        //if not, set to mystery mode
        inactive.SetActive(true);
    }
예제 #2
0
    public void InitFinalLevel(UILevelSelectItem[] items, UILevelSelectItem exclude)
    {
        mIsFinalLevel = true;

        int completeCount = 0;

        for (int i = 0; i < items.Length; i++)
        {
            if (items[i] != this && items[i] != exclude && items[i].isCompleted)
            {
                completeCount++;
            }
        }

        finalActiveGO.SetActive(completeCount == items.Length - 2);
    }
예제 #3
0
    protected override void OnActive(bool active)
    {
        if (active)
        {
            UILevelSelectItem levelSelected = finalLevel.isFinalUnlock ? finalLevel : gitgirl;
            UICamera.selectedObject = levelSelected.gameObject;

            mCurInfoSubActiveGO = levelSelected.infoSubActiveGO ? levelSelected.infoSubActiveGO : gitgirl.infoSubActiveGO;
            if (mCurInfoSubActiveGO)
            {
                mCurInfoSubActiveGO.SetActive(true);
            }

            foreach (UILevelSelectItem item in mLevelItems)
            {
                if (item.gameObject.activeSelf)
                {
                    item.listener.onClick  = OnLevelClick;
                    item.listener.onSelect = OnLevelSelect;
                }
            }

            if (Main.instance && Main.instance.input)
            {
                Main.instance.input.AddButtonCall(0, InputAction.MenuEscape, OnInputOptions);
                Main.instance.input.AddButtonCall(0, InputAction.Fire, OnInputInfo);
            }
        }
        else
        {
            foreach (UILevelSelectItem item in mLevelItems)
            {
                if (item.gameObject.activeSelf)
                {
                    item.listener.onClick  = null;
                    item.listener.onSelect = null;
                }
            }

            if (Main.instance && Main.instance.input)
            {
                Main.instance.input.RemoveButtonCall(0, InputAction.MenuEscape, OnInputOptions);
                Main.instance.input.RemoveButtonCall(0, InputAction.Fire, OnInputInfo);
            }
        }
    }