Example #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;
        }
        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);
        }