void Start() { wc = GameObject.Find("Bullets").GetComponent <WeaponBehaviour>(); visionSphere = transform.GetChild(1).gameObject; visionSphere.transform.localScale = new Vector3(visionRange * 2, visionRange * 2, 0.01f); api = GameObject.Find("Team1Controller").GetComponent <APIScript>(); anim = GetComponentInChildren <Animator>(); gc = GameObject.Find("GameController").GetComponent <GameController> (); StartCoroutine(Timers()); ResetStats(); }
int myTeamId; //This id is used for certain API calls and is unique for your team void Start() { api = gameObject.GetComponent <APIScript> (); myTeamId = api.teamId; myUnits = api.GetPlayers(myTeamId); }