예제 #1
0
    public static void Jump(ClassHero classHero)
    {
        BehaviourPhysics.Force(classHero.gameObject, Vector2.up, classHero.forceJump);

        AudioClip audio = classHero.sfx[0];

        BehaviourSound.Play(classHero.gameObject, audio);
    }
예제 #2
0
 public void GoToRoom(int id)
 {
     for (int i = distance; i < id - 1; i++)
     {
         DestroyRoom(i);
     }
     velocity -= 0.2f;
     BehaviourSound.Play(gameObject, sfx[0]);
     distance = id - 1;
 }
예제 #3
0
    public static void Score(ClassTrashCan dataTrashCan)
    {
        dataTrashCan.life += 1 * 5;

        if (dataTrashCan.life > 100)
        {
            dataTrashCan.life = 100;
        }

        BehaviourSound.Play("SFX/Point");
    }
예제 #4
0
파일: FacadeEarth.cs 프로젝트: Hosomy17/STW
    public static void Hurt(ClassEarth classEarth)
    {
        GameObject camera = GameObject.Find("Game Camera/Effect");

        BehaviourAnimation.Play(classEarth.gameObject, "Hurt");
        BehaviourAnimation.Play(camera, "Hurt");

        BehaviourSound.Play("SFX/Explosion");

        Camera.main.GetComponent <Shaker>().Shake(40f, 1);
    }
예제 #5
0
    public static void Guard(ClassHero classHero)
    {
        classHero.life += 3;
        if (classHero.life >= 100)
        {
            classHero.life = 100;
        }
        classHero.hp.fillAmount = classHero.life / 100;
        AudioClip audio = classHero.sfx[3];

        BehaviourSound.Play(classHero.gameObject, audio);
    }
예제 #6
0
    public static void Attack(ClassHero classHero)
    {
        //BehaviourPhysics.Force(classHero.gameObject, Vector2.right * classHero.faceRight, classHero.forceAttack);
        BehaviourPhysics.Move(classHero.gameObject, Vector2.right * classHero.faceRight, classHero.forceAttack);

        BehaviourAnimation.Play(classHero.gameObject, "Attack");

        if (!classHero.isAttack)
        {
            AudioClip audio = classHero.sfx[2];
            BehaviourSound.Play(classHero.gameObject, audio);
        }
    }
예제 #7
0
    public static void Damage(ClassHero classHero)
    {
        classHero.life         -= 10;
        classHero.hp.fillAmount = classHero.life / 100;
        if (classHero.life <= 0)
        {
            GameObject.Find("GameManager").GetComponent <GameScript>().GameOver();
        }

        GameObject.Find("GameManager").GetComponent <ManagerCamera>().DamageEffect();

        BehaviourAnimation.Play(classHero.gameObject, "Damage");

        AudioClip audio = classHero.sfx[1];

        BehaviourSound.Play(classHero.gameObject, audio);
    }
예제 #8
0
    public void Move()
    {
        gameObject.transform.localPosition = new Vector3(300 * side, -224 * distance, -9);

        shaker.Shake(3, 1.5f);
        Effect(transform.position, side);
        DestroyRoom(distance);
        BehaviourSound.Play(gameObject, sfx[0]);

        speed = -speed;
        side  = -side;

        FacadeEnemy.Walk(this, Vector2.right);
        Invoke("Move", velocity);

        distance++;
    }
예제 #9
0
 public void Kill()
 {
     BehaviourSound.Play(gameObject, sfx);
     gameObject.Recycle();
 }