//チームとゴールラインを決める public void Init(TD_GameManager gameMan) { gm = gameMan; if (letterTm == Letter.A) { gm.playerA.t = team; gm.playerA.door = door; } else { gm.playerB.t = team; gm.playerB.door = door; } TD_Character[] allcharacter = FindObjectsOfType <TD_Character>(); foreach (var item in allcharacter) { if (item.team == this.team) { TD_Ally ally = item.GetComponent <TD_Ally>(); if (ally != null) { robotList.Add(ally); } } else { enemylist.Add(item); } } pancakeball = FindObjectOfType <TD_PancakeBall>(); //イベントの設定 pancakeball.onTakingBall += onTakingBallReaction; }
//タイマー時間が終わったら終了 void finalCountDown() { gameEnd = true; TD_GameManager gm = FindObjectOfType <TD_GameManager>(); StartCoroutine(gm.gameEndCo()); }
private void Awake() { instance = this; gm = FindObjectOfType <TD_GameManager>(); startPosition = transform.position; gm.setResetableObjects(this.gameObject); }
public override void Init() { TD_GameManager gm = FindObjectOfType <TD_GameManager>(); gm.setResetableObjects(this.gameObject); ally = FindObjectOfType <TD_Ally>(); GameObject door = GameObject.FindGameObjectWithTag("door"); door.GetComponent <TD_PointZone>().tm = this.team; base.Init(); }
private void Start() { gm = FindObjectOfType <TD_GameManager>(); TD_Ally ally = GetComponent <TD_Ally>(); if (ally == null) { return; } stat = ally.status; giveValues(stat.health); }
//ゴールラインを探す void FindDoor() { TD_GameManager man = FindObjectOfType <TD_GameManager>(); man.setResetableObjects(this.gameObject); if (team != man.playerA.t) { enemyDoor = man.playerA.door; } else { enemyDoor = man.playerB.door; } }
//エネミーゴールラインを見付ける、イベントを設定する void lateInit() { TD_GameManager gm = FindObjectOfType <TD_GameManager>(); gm.setResetableObjects(this.gameObject); if (gm.playerA.t != team) { door = gm.playerA.door; } else { door = gm.playerB.door; } doorPos = new Vector3(door.transform.position.x, transform.position.y, door.transform.position.z); pancakeball.onTakingBall += reciveTarget; base.Init(); }