Ejemplo n.º 1
0
        void Update()
        {
            if (PositionSpring == null || RotationSpring == null)
            {
                //not inited
                return;
            }

            UpdateEarthQuake();

            if (CheckDone())
            {
                this.enabled = false;
                return;
            }
            PositionSpring.FixedUpdate();
            RotationSpring.FixedUpdate();
        }
Ejemplo n.º 2
0
        void UpdateSpring()
        {
            if (PositionSpring == null || RotationSpring == null)
            {
                //not inited
                return;
            }

            UpdateEarthQuake();

            PositionSpring.FixedUpdate();
            RotationSpring.FixedUpdate();

            Vector3 posPhase = m_client.transform.localPosition - mLastPosition;
            Vector3 rotPhase = m_client.transform.localEulerAngles - mLastRotation;

            transform.localPosition += posPhase;
            Vector3 curRot = transform.localRotation.eulerAngles;

            transform.localRotation = Quaternion.Euler(curRot + rotPhase);

            mLastPosition = m_client.transform.localPosition;
            mLastRotation = m_client.transform.localEulerAngles;
        }