Ejemplo n.º 1
0
    //add ammo when kunai picked up
    private void kunaiPickup(Collider2D collision)
    {
        playerAmmo theAmmo = collision.gameObject.GetComponent <playerAmmo>();

        theAmmo.addAmmo(ammoAmount);
        Destroy(gameObject);
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         gm.lastCheckpointPos = transform.position;
         playerHealth ph = player.GetComponent <playerHealth>();
         PlayerPrefs.SetFloat("StartLevelHealth", ph.currentHealth);
         playerChakra pc = player.GetComponent <playerChakra>();
         PlayerPrefs.SetFloat("StartLevelChakra", pc.currentChakra);
         playerAmmo pa = player.GetComponent <playerAmmo>();
         PlayerPrefs.SetFloat("StartLevelAmmo", pa.currentAmmo);
         Destroy(GetComponent <checkpoint>());
     }
 }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        myRB      = GetComponent <Rigidbody2D>();
        myAnim    = GetComponent <Animator>();
        theAmmo   = GetComponent <playerAmmo>();
        theChakra = GetComponent <playerChakra>();

        gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <gameMaster>();
        transform.position = gm.lastCheckpointPos;

        if (PlayerPrefs.GetString("ScrollObtained") == "true")
        {
            chakraHalf = true;
        }

        facingRight = true;
    }