コード例 #1
0
ファイル: Kazaguruma.cs プロジェクト: inonoa/tekiyoke2
    void FixedUpdate()
    {
        if (logRotateVel > logVelEpsilon)
        {
            float deltaTime = TimeManager.Current.FixedDeltaTimeExceptHero;

            float actualVelocity = Mathf.Exp(logRotateVel) * deltaTime;
            kuruma.Rotate(0, 0, -actualVelocity);

            if (IsRotatingEnough)
            {
                float velFirst = rotateVelPerSecFirst * deltaTime;
                mat.SetFloat("_Volume", actualVelocity / velFirst * edgeLightVolMax);
            }

            float tmpNextVel = logRotateVel - logVelDecay * deltaTime;

            if (logRotateVel >= logVelThreshold && tmpNextVel < logVelThreshold)
            {
                mat.SetFloat("_Volume", 0);
                OnSlow?.Invoke(this, EventArgs.Empty);
            }

            logRotateVel = tmpNextVel;
        }
    }
コード例 #2
0
ファイル: Controller.cs プロジェクト: SeanI115/BulletHellGame
 private void _OnSlow()
 {
     slow = true;
     OnSlow?.Invoke(this, EventArgs.Empty);
 }