Example #1
0
	void OnTriggerEnter2D (Collider2D other){

		if (other.tag=="Player"){
			GameLevelManager.AddCoins(Coinvalue);
			Destroy(gameObject);
		}
	}
Example #2
0
    // Update is called once per frame
    void Update()
    {
//         playerVelocity = new Vector3
//         Debug.Log(thePlayerBody.playerVelocity);
//         if(!isYogurting)
//         {
//             gameObject.SetActive(false);
//         }
//         else if (isYogurting)
//         {
//             gameObject.SetActive(true);
//         }
//         {
//             transform.localScale = new Vector3(-0.59983f, 0.59983f, 0.59983f);
//         }
//         if(Input.GetAxisRaw ("Horizontal") < 0f)
//         {
//             transform.localScale = new Vector3(0.59983f, 0.59983f, 0.59983f);
//         }
        if (Input.GetButtonDown("Jump") && theLevelManager.yogurtCount > 0f) //will use this control for attacking
        {
            gameObject.SetActive(true);
            isYogurting = true;
            theLevelManager.AddCoins(0, -1);
            StartCoroutine("YogurtingCo");
        }
        myAnim.SetFloat("Horizontal Speed", thePlayerBody.playerHorizontalVelocity);
        myAnim.SetFloat("Vertical Speed", thePlayerBody.playerVerticalVelocity);
        myAnim.SetBool("attacking", isYogurting);
    }
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag.Equals("Player"))
        {
            //ScoreScript.scoreValue += 10;
            //SoundManagerScript.PlaySound("");
            gameLevelManager.AddCoins(coinValue);
            ScoreTextScript.coinAmount += 1;
            switch (soundSelect)
            {
            case 1:
                FindObjectOfType <AudioManager2>().Play("CollectObject");
                break;

            case 2:
                FindObjectOfType <AudioManager2>().Play("CollectObject2");
                break;

            case 3:
                FindObjectOfType <AudioManager2>().Play("CollectObject3");
                break;
            }

            Destroy(gameObject);
        }
    }
Example #4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         theLevelManager.AddCoins(coinValue, yogurtValue);
         gameObject.SetActive(false);
     }
 }
Example #5
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         Destroy(gameObject);  //gameObject is a special name for the object the script is attached to.
     }
 }
Example #6
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         myLevelManager.AddCoins(coinValue);
         Destroy(gameObject);
     }
 }
Example #7
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         levelManager.AddCoins(coinValue);
         gameObject.SetActive(false);
     }
 }
Example #8
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         _levelManager.AddCoins(coinValue);
         Destroy(gameObject);
     }
 }
Example #9
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.CompareTag("Player"))
     {
         levelManager.AddCoins(worth);
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.IsPlayer())
     {
         gameObject.SetActive(false);
         levelManager.AddCoins(coinValue);
     }
 }
Example #11
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         Debug.Log("Your score is: " + gameLevelManager.coins);
         Destroy(gameObject);
     }
 }
Example #12
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         FindObjectOfType <AudioManager> ().Play("Coin");
         Destroy(gameObject);
         lvlManager.AddCoins(coinValue);
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("Triggered");
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         Destroy(gameObject);
     }
 }
Example #14
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            levelManager.AddCoins(coinValue);

            Destroy(gameObject);
        }
    }
Example #15
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(1);
         Destroy(gameObject);
         audioManager.Play("Coin");
     }
 }
Example #16
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         //  SoundManager.PlaySound("coinPickup");
         Destroy(gameObject);
     }
 }
Example #17
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         GameObject.Find("Warrior").GetComponent <Player_Score>().JewelCount += 1;;
         Destroy(gameObject);
     }
 }
Example #18
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "player")
     {
         gameLevelManager.AddCoins(coinValue);
         AudioSource.PlayClipAtPoint(zvok, other.transform.position);
         Destroy(gameObject);
     }
 }
Example #19
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Player")
     {
         levelmanager.AddCoins(coinValue);
         gameObject.SetActive(false);
         //Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D col)
 {
     Debug.Log(col.gameObject.name + " Collided with " + gameObject.name);
     if (col.CompareTag("Player"))
     {
         lm.AddCoins(CoinValue);
         Destroy(gameObject);
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         AudioSource.PlayClipAtPoint(coinPickUpSFX, Camera.main.transform.position);
         levelManager.AddCoins(coinValue);
         Destroy(gameObject);
     }
 }
Example #22
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         //when the player collides with coin, add the value to score and deactivate coin
         theLevelManager.AddCoins(coinValue);
         gameObject.SetActive(false);
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         gameLevelManager.AddCoins(coinValue);
         SoundManager.instance.RandomizeSfx(collectSound);
         Destroy(gameObject);
     }
 }
Example #24
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         myLevelManager.AddCoins(coinValue);
         //Destroy(gameObject);
         gameObject.SetActive(false);
     }
 }
Example #25
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "myPlayer")
     {
         _levelManager.AddCoins(coinValue);
         //this.GetComponent<AudioSource>().Play();
         //soundManager.sndMan.PlayCoinSound();
         Destroy(gameObject);
     }
 }
Example #26
0
 void OnTriggerEnter2D(Collider2D other)
 {
     //Adds coin(s) and destroys the attached object
     if (other.tag == "Player")
     {
         iLM.AddCoins(coinValue);
         Instantiate(coinCollectNoise, Camera.transform.position, Camera.transform.rotation);
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         FindObjectOfType <AudioManager>().Play("Coin");
         gameLevelManager.AddCoins(coinValue);
         Debug.Log("Score = " + gameLevelManager.score);
         Destroy(gameObject);
     }
 }
Example #28
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player" && !checkpointReached)
        {
            FindObjectOfType <AudioManager> ().Play("Treasure");
            checkpointSpriteRenderer.sprite = emptyChest; //allagh eikonas apo gemath se adeia
            checkpointReached = true;                     //true oti egine h allagh

            lvlManager.AddCoins(chestCoins);              //kane add sto score to poso twn coins ana chest
        }
    }
Example #29
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         Debug.Log("Trigger");
         pickUpSound.Play();
         _theLevelManager.AddCoins(coinValue);
         //Destroy(gameObject);
         gameObject.SetActive(false);
     }
 }
Example #30
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            levelManager.AddCoins(coinValue);
            levelManager.experience       += expPoints;
            levelManager.experienceForLvl += expPoints;

            gameObject.SetActive(false);
        }
    }