Exemple #1
0
        /// <summary>
        /// Cpuのテキストを設定
        /// </summary>
        /// <param name="type">Cpuのタイプ</param>
        /// <param name="cpu">Cpuレベル</param>
        private void SetCpuText(Pong.PlayerConstant.Type type, Pong.BoardCpuLevel cpu)
        {
            // テキストを取得
            string objName = "";

            if (type == PlayerConstant.Type.Cpu1)
            {
                objName = Cpu1LevelTextValueObjectName;
            }
            if (type == PlayerConstant.Type.Cpu2)
            {
                objName = Cpu2LevelTextValueObjectName;
            }
            var t = transform.Find(objName).GetComponent <UnityEngine.UI.Text>();

            UnityEngine.Assertions.Assert.IsNotNull(t);
            // レベルに応じて設定
            if (cpu.Get() == BoardCpuLevel.Level.Level1)
            {
                t.text = CpuLevel1Text;
                return;
            }
            if (cpu.Get() == BoardCpuLevel.Level.Level2)
            {
                t.text = CpuLevel2Text;
                return;
            }
        }
Exemple #2
0
        private void UpdateCvcCpuSelect1Prefab()
        {
            if (mainmenu.IsSelectedBack() == true)
            {
                Debug.Log("back");
                SwitchPrefab(Pong.MainmenuConstant.Type.PlayerModeSelect);
                return;
            }

            if (mainmenu.GetTransitionType() == Pong.MainmenuConstant.Type.CvcCpuLevelSelect2)
            {
                Debug.Log("select2");
                cpu1 = GetMainmenuCpuLevel();
                Debug.Log(cpu1.Get());
                SwitchPrefab(mainmenu.GetTransitionType());
                return;
            }
        }
Exemple #3
0
        private void UpdateCvcCpuSelect2Prefab()
        {
            if (mainmenu.IsSelectedBack() == true)
            {
                Debug.Log("back");
                SwitchPrefab(Pong.MainmenuConstant.Type.CvcCpuLevelSelect1);
                return;
            }

            if (mainmenu.GetTransitionType() == Pong.MainmenuConstant.Type.ConfirmPlay)
            {
                Debug.Log("confirm");
                cpu2 = GetMainmenuCpuLevel();
                Debug.Log(cpu2.Get());
                SwitchPrefab(mainmenu.GetTransitionType());
                return;
            }
        }
Exemple #4
0
        private void UpdatePvcCpuSelectPrefab()
        {
            if (mainmenu.IsSelectedBack() == true)
            {
                Debug.Log("back");
                SwitchPrefab(Pong.MainmenuConstant.Type.PlayerModeSelect);
                return;
            }

            if (mainmenu.GetTransitionType() == MainmenuConstant.Type.ConfirmPlay)
            {
                Debug.Log("Confirm");
                cpu = GetMainmenuCpuLevel();
                Debug.Log(cpu.Get());
                SwitchPrefab(mainmenu.GetTransitionType());
                return;
            }
        }