void Awake()
 {
     anim = GetComponent <Animator> ();
     playerAudio = GetComponent <AudioSource> ();
     playerMovement = GetComponent <PlayerMovement2> ();
     playerShooting = GetComponentInChildren <PlayerShooting2> ();
     currentHealth = startingHealth;
     mainCamera = GameObject.Find ("Main Camera 2").GetComponent<Camera>();
     PlayerCamera = GameObject.Find ("Main Camera").GetComponent<Camera>();
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     Lifes = new int[5];
     speed = 2f;
     Man = GameObject.Find("Manager").GetComponent<ProjectileManager>();
     PMan = GameObject.Find("Manager").GetComponent<PlayerManager>();
     Lifes = PMan.lifeCheck();
     bool[] pCheck = new bool[PMan.maxPCount];
     pCheck = PMan.playerCheck ();
     UporDown = Man.checkView();
     if(pCheck[0] == true && Lifes[0] < 3)
     PM = GameObject.Find("P1").GetComponent<PlayerMovement>();
     if(pCheck[1] == true && Lifes[1] < 3)
     PM2 = GameObject.Find("P2").GetComponent<PlayerMovement2>();
     if(pCheck[2] == true && Lifes[2] < 3)
     PM3 = GameObject.Find("P3").GetComponent<PlayerMovement3>();
     if(pCheck[3] == true && Lifes[3] < 3)
     PM4 = GameObject.Find("P4").GetComponent<PlayerMovement4>();
 }
Example #3
0
 void Start()
 {
     _PBody          = GetComponent <Rigidbody>();
     playerMovement2 = new PlayerMovement2();
     score           = 0;
 }