コード例 #1
0
    override public void OnCameraExit()
    {
        if (BulletTime.isEditing)
        {
            BulletTime.SampleAnimation(localAnimation, (localAnimation.cachedState != null)? localAnimation.cachedState.length: 0, true);
            BulletTime.SampleAnimation(localAnimation2, (localAnimation2.cachedState != null) ? localAnimation2.cachedState.length : 0, true);
        }

        if (audio != null)
        {
            foreach (var a in audio)
            {
                if (a && a.loop)
                {
                    a.Stop();
                }
            }
        }

        foreach (ParticleSystem ps in fx)
        {
            if (ps && (ps.loop || stopFxOnExit))
            {
                ps.Stop();
                ps.Clear();
            }
        }

        inside = false;
    }
コード例 #2
0
    virtual public void OnCameraStay(float timeInTrigger, float normalizedTimeInTrigger)
    {
        if (!camera)
        {
            return;
        }

        if (BulletTime.allowCameraTriggers && !cameraActive)
        {
            ActivateCamera();
        }
        else if (!BulletTime.allowCameraTriggers && cameraActive)
        {
            DeactivateCamera();
        }

        if (!BulletTime.allowCameraTriggers)
        {
            return;
        }

        camera.gameObject.SendMessage("OnCameraStay", normalizedTimeInTrigger, SendMessageOptions.DontRequireReceiver);

        if (BulletTime.isEditing)
        {
            BulletTime.SampleAnimation(localCameraAnimation, timeInTrigger, true);
            ApplyTweaks();
        }
    }
コード例 #3
0
    void SampleAnimation()
    {
        if (!BulletTime.isEditing)
        {
            return;
        }

        BulletTime.SampleAnimation(m_AnimatedObjects, true);
        foreach (var seq in m_Sequencers)
        {
            if (seq)
            {
                seq.Update();
            }
        }
    }
コード例 #4
0
    override public void OnCameraStay(float timeInTrigger, float normalizedTimeInTrigger)
    {
#if UNITY_EDITOR
        if (BulletTime.isEditing)
        {
            var t = (localAnimation.cachedState != null)? Mathf.Repeat(timeInTrigger, localAnimation.cachedState.length): timeInTrigger;
            BulletTime.SampleAnimation(localAnimation, t, true);
            //t = (localAnimation2.cachedState != null) ? Mathf.Repeat(timeInTrigger, localAnimation2.cachedState.length) : timeInTrigger;
            t = timeInTrigger;
            BulletTime.SampleAnimation(localAnimation2, t, true);

            updateTimeInTrigger = timeInTrigger;
        }
#endif

        if (Application.isPlaying && BulletTime.timeJump)
        {
            //;;Debug.Log("Animation Time Jump " + timeInTrigger);
            if (target != null && target.GetComponent <Animation>() != null)
            {
                foreach (AnimationState state in target.GetComponent <Animation>())
                {
                    //if (state.enabled && state.weight > 0)
                    state.time = timeInTrigger;
                }
            }
            if (target2 != null && target2.GetComponent <Animation>() != null)
            {
                foreach (AnimationState state in target2.GetComponent <Animation>())
                {
                    //if (state.enabled && state.weight > 0)
                    state.time = timeInTrigger;
                }
            }
        }
    }