예제 #1
0
    // Update is called once per frame
    void Update()
    {
        fireDown1 = input.GetDown(input.fire1);
        fireDown2 = input.GetDown(input.fire2);
        fireUp1   = input.GetUp(input.fire1);
        fireUp2   = input.GetUp(input.fire2);

        released1 = fireUp1 && firing1 ? true : released1;
        released2 = fireUp2 && firing2 ? true : released2;

        if (fireDown1 && !(firing1 || firing2))
        {
            draw1();
        }
        else if (fireDown2 && !(firing1 || firing2))
        {
            draw2();
        }

        if (released1 && !bow.animation["Draw"].enabled)
        {
            release1();
        }
        else if (released2 && !bow.animation["Draw"].enabled)
        {
            release2();
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (input.GetDown(input.fire2))
        {
            if (animation["Up"].time < 0)
            {
                animation["Up"].time = 0;
            }
            animation["Up"].speed = 1;
        }
        else if (input.GetUp(input.fire2))
        {
            if (animation["Up"].time > animation["Up"].length)
            {
                animation["Up"].time = animation["Up"].length;
            }
            animation["Up"].speed = -1;
        }
        animation.Play("Up");

        if (animation["Up"].time >= animation["Up"].length)
        {
            wasDown = false;
            if (!wasUp)
            {
                wasUp = true;
                player.physicalResistance *= 2;
            }
        }
        else if (!wasDown)
        {
            wasUp   = false;
            wasDown = true;
            player.physicalResistance /= 2;
        }
    }