Пример #1
0
        protected override void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName)
        {
            base.OnButtonClickWithButtonName(button, pButtonName);

            switch (pButtonName)
            {
            case "doll":
                CocoMainController.ShowPopup("RoleSelectedPopup");
                m_RoleSelectPopup = FindObjectOfType <RoleSelectedPopup>();
                if (m_RoleSelectPopup != null)
                {
                    m_RoleSelectPopup.OnCloseDollSelect += OnChangeDoll;
                }
                break;

            case "Talk":
                StartCoroutine(HideTalk());
                break;

            case "start":
                GlobalData.curSelectRole = -1;
                CocoMainController.EnterScene(CocoSceneID.Doll);
                break;
            }
        }
Пример #2
0
        private void OnChangeDoll(bool change)
        {
            if (change)
            {
                if (GlobalData.curSelectRole != -1)
                {
                    roleControl.CurRole.Dress.AddDressItem(recordStateModel.RecordDolls[GlobalData.curSelectRole].dress);

                    List <string> body = roleControl.CurRole.Dress.GetDressIdsByCategory("body");
                    List <string> ear  = roleControl.CurRole.Dress.GetDressIdsByCategory("ear");
                    List <string> nose = roleControl.CurRole.Dress.GetDressIdsByCategory("nose");
                    List <string> tail = roleControl.CurRole.Dress.GetDressIdsByCategory("tail");
                    List <string> ids  = body.Union(ear).Union(nose).Union(tail).ToList <string>();
                    foreach (string id in ids)
                    {
                        var dress = roleControl.CurRole.Dress.GetDressItem(id);
                        SkinnedMeshRenderer render = dress.ItemRenderers[0];
                        for (int i = 0; i < render.materials.Length; i++)
                        {
                            Texture2D normal = Resources.Load <Texture2D> (string.Format("role/basic/basic/textures/common/material_{0:D3}_nomal", recordStateModel.RecordDolls[GlobalData.curSelectRole].detailIndex));
                            Texture2D rgb    = Resources.Load <Texture2D> (string.Format("role/basic/basic/textures/common/material_{0:D3}_rgb", recordStateModel.RecordDolls[GlobalData.curSelectRole].detailIndex));
                            render.materials[i].SetTexture("_BumpMap", normal);
                            render.materials[i].SetTexture("_metallicRsmoothGdiffuseB", rgb);
                        }
                    }
                }
                CocoMainController.EnterScene(CocoSceneID.Doll);
            }
        }
Пример #3
0
 protected override void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName)
 {
     base.OnButtonClickWithButtonName(button, pButtonName);
     if (pButtonName == "btnCoverPageStart")
     {
         CocoMainController.EnterScene(CocoSceneID.Map);
     }
 }
Пример #4
0
        protected override void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName)
        {
            base.OnButtonClickWithButtonName(button, pButtonName);

            if (pButtonName == "next")
            {
                switch (m_CurSceneStep)
                {
                case SceneStep.Step_Common:
                    m_CurSceneStep = SceneStep.Step_Detail;
                    StartCoroutine(ShowDetail());
                    break;

                case SceneStep.Step_Detail:
                    m_CurSceneStep = SceneStep.Step_Finish;
                    button.gameObject.SetActive(false);
                    StartCoroutine(PlayAni());
                    break;

                default:
                    m_CurSceneStep = SceneStep.Step_Common;
                    break;
                }
            }
            else if (pButtonName == "font")
            {
                switch (m_CurSceneStep)
                {
                case SceneStep.Step_Common:
                    CocoMainController.EnterScene(CocoSceneID.Map);
                    break;

                case SceneStep.Step_Detail:
                    m_CurSceneStep = SceneStep.Step_Common;
                    break;

                case SceneStep.Step_Finish:
                    m_CurSceneStep = SceneStep.Step_Detail;
                    StartCoroutine(ShowDetail());
                    break;

                default:
                    m_CurSceneStep = SceneStep.Step_Common;
                    break;
                }
            }
            else if (pButtonName == "doll")
            {
                CocoMainController.ShowPopup("RoleSelectedPopup");
                m_RoleSelectPopup = FindObjectOfType <RoleSelectedPopup>();
                if (m_RoleSelectPopup != null)
                {
                    m_RoleSelectPopup.OnCloseDollSelect += OnChangeDoll;
                }
            }
        }
Пример #5
0
        private IEnumerator PlayAni()
        {
            RecordDoll();

            yield return(StartCoroutine(GetComponent <GameDollUIControl> ().HideAni()));

            yield return(StartCoroutine(m_CurRole.Animation.StartPlay(dressupData.CA_Dressup_win01)));

            yield return(StartCoroutine(m_CurRole.Animation.StartPlay(dressupData.CA_Dressup_win02)));

            CocoMainController.EnterScene(CocoSceneID.RecordVolue);
        }
Пример #6
0
        public static void Show(string title, string message, string button, string otherButton, Action <string> buttonAction)
        {
            var alertView = CocoMainController.ShowPopup <SimpleAlertView> ("native/SimpleAlertView");

            if (alertView == null)
            {
                return;
            }

            alertView.InitContent(title, message, button, otherButton);

            alertView._onButtonClickEvent = buttonAction;
        }
Пример #7
0
    protected override void CloseBtnClick()
    {
        ClosePopup();

        if (GlobalData.BackToSceneID != CocoSceneID.None)
        {
            CocoMainController.EnterScene(GlobalData.BackToSceneID);
        }
        else
        {
            CocoMainController.EnterScene(CocoSceneID.Map);
        }
    }
Пример #8
0
        protected override void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName)
        {
            switch (pButtonName)
            {
            case "BubbleButton":
                CocoMainController.EnterScene(nextSceneId);
                break;

            default:
                base.OnButtonClickWithButtonName(button, pButtonName);
                break;
            }
        }
Пример #9
0
        protected override void OnButtonClickWithButtonId(CocoUINormalButton button, CocoUIButtonID buttonID)
        {
            switch (buttonID)
            {
            case CocoUIButtonID.Common_Complete:
                CocoMainController.EnterScene(nextSceneId);
                break;

            default:
                base.OnButtonClickWithButtonId(button, buttonID);
                break;
            }
        }