void OnTriggerEnter2D(Collider2D col) { if (col.GetComponent <TopDownPlayer>()) { infoTracker.GetComponent <AreaDisplay>().SetFoodCount(StateSaver.gameState.areas[(int)togo].foodCount); infoTracker.SetActive(true); player = col.GetComponent <TopDownPlayer>(); canLeave = true; } }
// Use this for initialization void Start() { speed = Random.Range(min, max); distance = Random.Range(6f, 10f); player = FindObjectOfType <TopDownPlayer>(); health = FindObjectOfType <PlayerHealth>(); line = gameObject.AddComponent <LineRenderer>(); line.endWidth = line.startWidth = 0.1f; line.startColor = line.endColor = Color.red; line.positionCount = 2; line.material = mat; }
void Awake () { _player = GameObject.FindGameObjectWithTag ("Player").GetComponent<TopDownPlayer> (); }
// Use this for initialization void Start() { player = FindObjectOfType <TopDownPlayer>(); }
void Awake () { _player = GetComponent<TopDownPlayer> (); }
void Awake () { GameObject l_playerGO = GameObject.FindGameObjectWithTag ("Player"); _player = l_playerGO.GetComponent<Player>(); _TDPlayer = l_playerGO.GetComponent<TopDownPlayer> (); }