Example #1
0
 // Use this for initialization
 void Start()
 {
     for (int x = 0; x < 4; x++)
     {
         children[x] = gameObject.transform.GetChild(x);
         childrenSprite[x] = children[x].GetComponent<SpriteRenderer>();
         childrenAnimator[x] = children[x].GetComponent<Animator>();
         playerControllers[x] = players[x].GetComponent<PlayerMotion>();
     }
     cameraFollowScript = cameraFollow.GetComponent<PlayerMediam>();
     zap = GetComponent<AudioSource>();
 }
Example #2
0
	// Use this for initialization
	void Start ()
	{
		//Debug.Log ("Start!");
		playerVotes.Add (p1Votes);
		playerVotes.Add (p2Votes);
		playerVotes.Add (p3Votes);
		playerVotes.Add (p4Votes);
		timerText.text = timer.ToString();

		for (int i = 0; i < 4; ++i) {
			for (int ii = 0; ii < 4; ++ii) {
				playerVotes[i].Add(gameObject.transform.FindChild("P"+ (i+1) + "Vote" + (ii+1)));
				playerVotes[i][ii].GetComponent<SpriteRenderer> ().enabled = false;
			}
		}
		cameraFollowScript = GetComponentInParent<PlayerMediam> ();
		stormShock = storm.GetComponent<Shocking> ();
		Center = GetComponent<SpriteRenderer> ();
		Center.enabled = voting;
	}