Esempio n. 1
0
        public override void OnBegin()
        {
            base.OnBegin();
            //if last camera shake event is not finished, just ignore this one.
            if (m_cameraShake.enabled && m_cameraShake.Client != null)
            {
                Debug.Log("Camera Shake Event is in use! please wait a moment");
                return;
            }

            m_cameraShake.Reset(m_owner);
            //add instant force
            m_cameraShake.PositionSpring.AddForce(m_owner.PositionForce);
            m_cameraShake.RotationSpring.AddForce(m_owner.RotationForce);
            m_cameraShake.enabled           = true;
            m_cameraShake.EarthQuakeToggled = true;
        }
Esempio n. 2
0
        public override void OnBegin()
        {
            base.OnBegin();

            m_cameraShake.Reset(m_owner);

            if (m_owner.CameraShakeType == XCameraShakeType.Spring)
            {
                //add instant force
                m_cameraShake.PositionSpring.AddForce(m_owner.PositionForce);
                m_cameraShake.RotationSpring.AddForce(m_owner.RotationForce);

                m_cameraShake.EarthQuakeToggled = m_owner.UseEarthQuake;
            }

            m_cameraShake.enabled = true;
        }
Esempio n. 3
0
        public override void Update(float deltaTime)
        {
            if (m_editorFlag)
            {
                return;
            }

            m_elapsedTime += deltaTime;
            if (m_elapsedTime > m_owner.StartTime && !m_eventFired)
            {
                m_eventFired = true;

                m_cameraShake.Reset(m_owner);


                //add instant force
                m_cameraShake.PositionSpring.AddForce(m_owner.PositionForce);
                m_cameraShake.RotationSpring.AddForce(m_owner.RotationForce);

                m_cameraShake.enabled           = true;
                m_cameraShake.EarthQuakeToggled = true;
            }
        }