Example #1
0
        private void SetComponents()
        {
            Transform t = this.transform;

            foreach (Transform tr in t)
            {
                switch (tr.tag)
                {
                case BLUE_AGENT_TAG:
                    this.blueAgent = tr.GetComponent <PlayerAgent>();
                    break;

                case RED_AGENT_TAG:
                    this.redAgent = tr.GetComponent <PlayerAgent>();
                    break;

                case BLUE_INFO_TAG:
                    this.blueBattleInfo = tr.GetComponent <BattleInfo>();
                    break;

                case RED_INFO_TAG:
                    this.redBattleInfo = tr.GetComponent <BattleInfo>();
                    break;
                }
            }
        }
Example #2
0
 public virtual void Start()
 {
     // Initialize arena, enemy and battle info
     this.battleArena = GetComponentInParent <BattleArena>();
     this.enemy       = battleArena.GetRival(tag).GetPlayer();
     this.battleInfo  = battleArena.GetBattleInfo(tag);
     // Set name and collision manager of player
     this.player.SetName(tag);
     this.player.SetCollisionManager(battleArena.GetCollisionManager());
     // Initialize player rewards
     this.rewards = new PlayerRewards(this.player.GetName(), MaxStep);
 }