Exemplo n.º 1
0
    public override void HideUI()
    {
        if (sampleUI != null)
        {
            AnimationMgr.GetInstance().AnimPlay(sampleUI, hideAnimID);
        }

        RemoveListener();
        isButton = true;
    }
Exemplo n.º 2
0
    private void BackShow()
    {
        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);
        }

        if (sampleUI != null)
        {
            AnimationMgr.GetInstance().AnimPlay(sampleUI, showAnimID);
        }

        isButton = false;
    }
Exemplo n.º 3
0
    // 初始化 必须保留 base.Init();
    public override void Init()
    {
        EventCenter.GetInstance().RemoveEventListener(EventData.ShowHelpUI, ShowUI);

        base.Init();

        sampleUI   = GetComponent <Animator>();
        showAnimID = AnimationMgr.GetInstance().GetAnimationID(animName);

        backBtn = GetControl <Button>(backButtonName);

        isButton = true;

        EventCenter.GetInstance().AddEventListener(EventData.ShowHelpUI, ShowUI);
    }
Exemplo n.º 4
0
    public override void ShowUI()
    {
        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);
        }

        if (sampleUI != null)
        {
            AnimationMgr.GetInstance().AnimPlay(sampleUI, showAnimID);
        }

        AddListener();

        isButton = false;
    }
Exemplo n.º 5
0
        public void Init()
        {
            //指定游戏以640x960的分辨率打开游戏
            Screen.SetResolution(1920, 1080, true);

            InputController.GetInstance().IsAwakeStart = true;
            input          = InputController.GetInstance();
            bodyController = bodyControllerTrans != null?bodyControllerTrans.GetComponent <BodyController>() : null;

            if (bodyController != null)
            {
                rotateTransParent = bodyController.RotateTrans;
                resetTransParent  = bodyController.transform;
            }
            beClickAnim = AnimationMgr.GetInstance().GetAnimationID("beClick");
            isGameStart = false;
            RemoveListener();
        }
Exemplo n.º 6
0
        public void TargetObjOnClickAnimPlay(GameObject _targetObj)
        {
            if (!isActive)
            {
                return;
            }

            if (_targetObj == null)
            {
                return;
            }

            Animator tempAnim = _targetObj.GetComponent <Animator>();

            if (tempAnim == null)
            {
                return;
            }

            AnimationMgr.GetInstance().AnimPlay(tempAnim, beClickAnim, 0);
        }
Exemplo n.º 7
0
    public override void Init()
    {
        EventCenter.GetInstance().RemoveEventListener <int>("PartUIToListUI", ShowUI);

        base.Init();

        sampleUI   = GetComponent <Animator>();
        showAnimID = AnimationMgr.GetInstance().GetAnimationID(animName);

        backBtn = GetControl <Button>(backButtonName);


        aBtn = GetControl <Button>("gridA");
        bBtn = GetControl <Button>("gridB");
        cBtn = GetControl <Button>("gridC");
        dBtn = GetControl <Button>("gridD");

        isButton = true;


        EventCenter.GetInstance().AddEventListener <int>("PartUIToListUI", ShowUI);
    }
Exemplo n.º 8
0
    public override void Init()
    {
        base.Init();

        sampleUI   = GetComponent <Animator>();
        showAnimID = AnimationMgr.GetInstance().GetAnimationID(animShowName);
        hideAnimID = AnimationMgr.GetInstance().GetAnimationID(animHideName);

        playBtn     = GetControl <Button>(playButtonName);
        backPartBtn = GetControl <Button>(backPartButtonName);
        musicBtn    = GetControl <Button>(musicButtonName);
        helpBtn     = GetControl <Button>(helpButtonName);

        musicImag = GetControl <Image>(musicButtonName);

        if (musicBtn)
        {
            musicOn  = musicBtn.spriteState.selectedSprite;
            musicOff = musicBtn.spriteState.disabledSprite;
        }

        isButton = true;
    }
Exemplo n.º 9
0
    public override void Init()
    {
        EventCenter.GetInstance().RemoveEventListener("MainUIToPartUI", ShowUI);

        btnPartID = new int[partTrans.Count];
        partBtn   = new Button[partTrans.Count];
        Image[] partImage = new Image[partTrans.Count];
        Text[]  textA     = new Text[partTrans.Count];
        Text[]  textB     = new Text[partTrans.Count];

        Transform[] childTextA  = new Transform[partTrans.Count];
        Transform[] childTextB  = new Transform[partTrans.Count];
        Transform[] childButton = new Transform[partTrans.Count];

        if (partTrans != null && partTrans.Count > 0 && partUIDatas != null && partTrans.Count <= partUIDatas.buttonDatas.Length)
        {
            for (int i = 0; i < partTrans.Count; i++)
            {
                if (partTrans[i] == null)
                {
                    continue;
                }
                childTextA[i]  = partTrans[i].GetChild(0);
                childTextB[i]  = partTrans[i].GetChild(1);
                childButton[i] = partTrans[i].GetChild(2);

                childTextA[i].name  = i.ToString();
                childTextB[i].name  = partUIDatas.buttonDatas[i].partIDName != string.Empty ? partUIDatas.buttonDatas[i].partIDName : ((char)(65 + i)).ToString();
                childButton[i].name = partUIDatas.buttonDatas[i].partName != string.Empty ? partUIDatas.buttonDatas[i].partName : partTrans[i].gameObject.name;
                btnPartID[i]        = i;
            }
        }


        base.Init();

        sampleUI   = GetComponent <Animator>();
        showAnimID = AnimationMgr.GetInstance().GetAnimationID(animName);

        backBtn = GetControl <Button>(backButtonName);


        if (partUIDatas != null && partUIDatas.buttonDatas != null && GameDataController.GetInstance() != null)
        {
            for (int j = 0; j < partUIDatas.buttonDatas.Length; j++)
            {
                if (partUIDatas.buttonDatas[j] != null)
                {
                    if (j == 0)
                    {
                        partUIDatas.buttonDatas[j].isLock = false;
                        continue;
                    }

                    if (GameDataController.GetInstance().IsPartClearance(partUIDatas.buttonDatas[j - 1].partName))
                    {
                        partUIDatas.buttonDatas[j].isLock = false;
                        // Debug.Log("islock");
                    }
                    else
                    {
                        partUIDatas.buttonDatas[j].isLock = true;
                    }
                }
            }
        }


        if (partTrans != null && partUIDatas.buttonDatas != null)
        {
            for (int i = 0; i < partTrans.Count; i++)
            {
                btnPartID[i] = i;
                partBtn[i]   = GetControl <Button>(childButton[i].name);
                partImage[i] = GetControl <Image>(childButton[i].name);

                if (partImage[i] && partUIDatas.buttonDatas[i] != null)
                {
                    partImage[i].sprite = partUIDatas.buttonDatas[i].buttonImage;
                }

                if (partBtn[i] != null && partUIDatas.buttonDatas[i] != null)
                {
                    partBtn[i].interactable = !partUIDatas.buttonDatas[i].isLock;
                }

                textA[i] = GetControl <Text>(childTextA[i].name);
                textB[i] = GetControl <Text>(childTextB[i].name);

                if (textA[i] && partUIDatas.buttonDatas[i] != null)
                {
                    textA[i].text = partUIDatas.buttonDatas[i].partName;
                }
                if (textB[i])
                {
                    textB[i].text = childTextB[i].name;
                }
            }
        }

        ABtn = GetControl <Button>("ANAXIMANDER");

        partImage   = null;
        textA       = null;
        textB       = null;
        childTextA  = null;
        childTextB  = null;
        childButton = null;

        isButton = true;
        EventCenter.GetInstance().AddEventListener("MainUIToPartUI", ShowUI);
    }