示例#1
0
文件: Coin.cs 项目: ukibs/Astar
 // Update is called once per frame
 void Update()
 {
     //
     if ((player.position - transform.position).magnitude < distanceToGetCoin)
     {
         // Efecto de coger monead
         //Debug.Log("Moneda cogida");
         hud.AddCoin();
         //
         Destroy(gameObject);
     }
     //
     transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
 }
示例#2
0
 //Add coin function caller;
 public void AddCoin(int value, bool reward = false)
 {
     hud.AddCoin(value, reward);
 }