// Use this for initialization
 void Start()
 {
     rb           = GetComponent <Rigidbody2D>();
     anim         = GetComponent <Animator>();
     facingRight  = true;
     playerSounds = GetComponent <playerAudio>();
     fireActive   = false;
     iceActive    = false;
     arcaneActive = true;
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        GM             = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
        PM             = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerManager>();
        UIMan          = GameObject.FindGameObjectWithTag("UI").GetComponent <UIManager>();
        currentHealth  = playerMaxHealth;
        isInvulnerable = false;
        playerSounds   = GetComponent <playerAudio>();

        //playerLives = 3;
    }
Example #3
0
 public void playSound(playerAudio audioClipToPlay, PlayerIndex index)
 {
     if (index == PlayerIndex.One)
     {
         audioPlayer.PlayOneShot(player1AudioClips[(int)audioClipToPlay], SFXVolume * (1 / audioPlayer.volume));
     }
     else
     {
         audioPlayer.PlayOneShot(player1AudioClips[(int)audioClipToPlay], SFXVolume * (1 / audioPlayer.volume));
     }
 }
    void Start()
    {
        thisObjTrans = GetComponent <Transform> ();
        controller   = GetComponent <playerController> ();
        playerAudio  = GetComponent <playerAudio>();
        anim         = GetComponent <Animator> ();

        gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
        Time.timeScale  = timeScale;;
        isDead          = false;
    }
Example #5
0
    void Start()
    {
        shaker = cam.GetComponent <CameraShaker>();
        Debug.Assert(shaker != null);

        deathEffect = cam.GetComponent <DeathEffectShader>();
        Debug.Assert(deathEffect != null);

        for (int i = 0; i < weaponsList.Length; i++)
        {
            gunScript gun = weaponsList[i].GetComponent <gunScript>();

            gunScriptList.Add(gun);
        }

        audioController = GetComponentInChildren <playerAudio>();
        Debug.Assert(audioController != null);
    }