Beispiel #1
0
        //チームとゴールラインを決める
        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;
        }
 private void Awake()
 {
     instance      = this;
     gm            = FindObjectOfType <TD_GameManager>();
     startPosition = transform.position;
     gm.setResetableObjects(this.gameObject);
 }
Beispiel #3
0
 public override void Init()
 {
     agent       = GetComponent <NavMeshAgent>();
     anim        = GetComponent <Animator>();
     pancakeball = FindObjectOfType <TD_PancakeBall>();
     findTarget();
     Invoke("lateInit", 2.5f);
 }