예제 #1
0
    void PhaseTwo()
    {
        if (changePhase)
        {
            sprite2.enabled = true;
            changePhase     = false;
            lifes           = 3;
            chestDrop.Drop();
        }

        moveSpeed = 5f;

        horPos += dir * moveSpeed * Time.fixedDeltaTime;

        if (transform.position.x > 7.0f)
        {
            dir = -1f;
        }
        else if (transform.position.x < -7.0f)
        {
            dir = 1f;
        }

        if (transform.position.y <= ground && !isHit)
        {
            startJump = true;
            jumping   = true;
        }

        if (startJump)
        {
            StartCoroutine(WaitForJump());
            startJump = false;
        }
    }