// 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); }
/// <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; } }
public void SetGameTaskScript(GameTask task) { gameTask = task; }