示例#1
0
    public void LaunchShake(ShakeTypes shakeType)
    {
        if (isShaking && currentShakeParameter.shakeType > shakeType)
        {
            return;
        }

        bool foundShakeParameter = false;

        foreach (ShakeParameters shakeParameter in shakelist)
        {
            if (shakeParameter.shakeType == shakeType)
            {
                currentShakeParameter = shakeParameter;
                foundShakeParameter   = true;
            }
        }

        if (!foundShakeParameter)
        {
            return;
        }

        isShaking = true;

        ApplyShakeParameters(currentShakeParameter);
    }
    public void BeginShake(ShakeTypes shake)
    {
        this.currentShake = shake;

        if (timer >= shakeTime)
        {
            timer = 0;
        }
    }