Example #1
0
        // Start is called before the first frame update
        void Start()
        {
            // textの関連付け
            UnityEngine.Assertions.Assert.IsNotNull(textGameObject);
            text = textGameObject.GetComponent <UnityEngine.UI.Text>();
            UnityEngine.Assertions.Assert.IsNotNull(text);
            // score関連付け
            UnityEngine.Assertions.Assert.IsNotNull(gameTaskObject);
            GameTask task = gameTaskObject.GetComponent <GameTask>();

            UnityEngine.Assertions.Assert.IsNotNull(task);
            task.AddScoreObserver(this);
        }
Example #2
0
 /// <summary>
 /// プレイヤータイプを設定
 /// </summary>
 /// <param name="gameTask">ゲームスクリプト</param>
 private void SetPlayerType(GameTask gameTask)
 {
     if (mode == Mode.PvC)
     {
         gameTask.SetPlayerType(PlayerConstant.Position.Left, PlayerConstant.Type.Man);
         gameTask.SetPlayerType(PlayerConstant.Position.Right, ConvertType(cpu.Get()));
         return;
     }
     if (mode == Mode.CvC)
     {
         gameTask.SetPlayerType(PlayerConstant.Position.Left, ConvertType(cpu1.Get()));
         gameTask.SetPlayerType(PlayerConstant.Position.Right, ConvertType(cpu2.Get()));
         return;
     }
 }
Example #3
0
 public void SetGameTaskScript(GameTask task)
 {
     gameTask = task;
 }