private void Start()
 {
     if (transform.parent.transform.childCount > 1)
     {
         falseFloorStack = transform.parent.transform.GetChild(1).gameObject;
     }
     colorChange = GetComponentInChildren <ColorChangeScript>();
 }
예제 #2
0
	void Awake ()
	{
		// Setting up references.
//		playerControl = GetComponent<PlayerControl>();
		health = new float[] { healthFactor, healthFactor, healthFactor } ;
		healthBar = new SpriteRenderer[] 
		{
			GameObject.Find("RedHealthBar").GetComponent<SpriteRenderer>(), 
			GameObject.Find("BlueHealthBar").GetComponent<SpriteRenderer>(),
			GameObject.Find("GreenHealthBar").GetComponent<SpriteRenderer>()
		};
		anim = GetComponent<Animator>();

		// Getting the intial scale of the healthbar (whilst the player has full health).
		healthScale = healthBar[0].transform.localScale;
		script = gameObject.GetComponent<ColorChangeScript> ();

		UpdateHealthBar ();
	}
 // Use this for initialization
 void Start()
 {
     script = gameObject.GetComponent <ColorChangeScript> ();
 }
 private void Start()
 {
     street      = GameObject.Find("Reference Street");
     uFloor      = GameObject.Find("Reference Upper Floor");
     colorChange = GetComponentInChildren <ColorChangeScript>();
 }