void Update()
        {
            if (m_Parent == null)
            {
                Destroy(gameObject);
                return;
            }

            VisualUtils.SmoothMove(transform, m_Parent.transform, Time.deltaTime, ref m_SmoothedSpeed, k_MaxTurnRateDegreesSecond);
        }
예제 #2
0
        void Update()
        {
            if (Parent == null)
            {
                // since we aren't in the transform hierarchy, we have to explicitly die when our parent dies.
                Destroy(gameObject);
                return;
            }

            VisualUtils.SmoothMove(transform, Parent.transform, Time.deltaTime, ref m_SmoothedSpeed, k_MaxRotSpeed);

            if (m_ClientVisualsAnimator)
            {
                // set Animator variables here
                float visibleSpeed = 0;
                if (m_NetState.NetworkLifeState.Value == LifeState.Alive)
                {
                    visibleSpeed = m_NetState.VisualMovementSpeed.Value;
                }
                m_ClientVisualsAnimator.SetFloat("Speed", visibleSpeed);
            }

            m_ActionViz.Update();
        }