Пример #1
0
 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;
     }
 }
Пример #2
0
 // 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;
 }
Пример #3
0
	void Awake ()
	{
		_player = GameObject.FindGameObjectWithTag ("Player").GetComponent<TopDownPlayer> ();	
	}
Пример #4
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType <TopDownPlayer>();
 }
Пример #5
0
	void Awake ()
	{
		_player = GetComponent<TopDownPlayer> ();	
	}
Пример #6
0
	void Awake ()
	{
		GameObject l_playerGO = GameObject.FindGameObjectWithTag ("Player");
		_player = l_playerGO.GetComponent<Player>();	
		_TDPlayer = l_playerGO.GetComponent<TopDownPlayer> ();
	}