예제 #1
0
 void attack()
 {
     if (timer <= 0)
     {
         player.Health(1);
         attackSound.Play();
         if (player.Phealth <= 0)
         {
             Skel.Play("SkeletonArmature|Skeleton_Idle");
         }
         timer = timerT;
     }
     else
     {
         timer -= Time.deltaTime;
     }
 }
예제 #2
0
파일: Show.cs 프로젝트: RyanChakov/Sbeve
    public void Heal2(float healthAddCost)
    {
        //super weird bug cant pass multiples things through to the first number is heal added the next 3 numbers are the cost

        float cost      = healthAddCost % 1000;
        float healthAdd = (healthAddCost - cost) / 1000;

        if (cost <= money.totalmoney)
        {
            money.Buy(cost);
            print("This is the health:" + healthAdd + " and this is the cost:" + cost);
            health.Health(-healthAdd);
            Audio(purchase);
        }
        else
        {
            Audio(notenough);
        }
    }
예제 #3
0
    void OnControllerColliderHit(ControllerColliderHit hit)
    {
        if (hit.collider.tag == "Trampoline")
        {
            transform.position = new Vector3(end.position.x + 10, end.position.y + 10, end.position.z);
            Tele.Play();
        }

        if (hit.collider.tag == "Teleporter")
        {
            transform.position = new Vector3(start.position.x + 10, start.position.y + 10, start.position.z);
            Tele.Play();
        }

        if (hit.collider.tag == "Death")
        {
            health.Health(100);
        }
    }