コード例 #1
0
ファイル: DistanceGrabber.cs プロジェクト: Alex666-sup/SASKA
        void Update()
        {
            Debug.DrawRay(transform.position, transform.forward, Color.red, 0.1f);

            DistanceGrabbable target;
            Collider          targetColl;

            FindTarget(out target, out targetColl);

            if (target != m_target)
            {
                if (m_target != null)
                {
                    m_target.Targeted = m_otherHand.m_target == m_target;
                }
                if (m_target != null)
                {
                    m_target.ClearColor();
                }
                if (target != null)
                {
                    target.SetColor(m_focusColor);
                }
                m_target         = target;
                m_targetCollider = targetColl;
                if (m_target != null)
                {
                    m_target.Targeted = true;
                }
            }
        }
コード例 #2
0
        void Update()
        {
            Debug.DrawRay(transform.position, transform.forward, Color.red, 0.1f);

            DistanceGrabbable target;
            Collider          targetColl;

            FindTarget(out target, out targetColl);

            if (!m_canScaleObjects)
            {
                m_debounceTime -= Time.fixedDeltaTime;
            }

            if (m_debounceTime < 0.0f)
            {
                m_debounceTime    = 0.1f;
                m_canScaleObjects = true;
            }

            if (target != m_target)
            {
                if (m_target != null)
                {
                    m_target.Targeted = m_otherHand.m_target == m_target;
                }
                if (m_target != null)
                {
                    m_target.ClearColor();
                }
                if (target != null)
                {
                    target.SetColor(m_focusColor);
                }
                m_target         = target;
                m_targetCollider = targetColl;
                if (m_target != null)
                {
                    m_target.Targeted = true;
                }
            }
        }