示例#1
0
 public void OnCollision(Collider collider)
 {
     if (collider == m_startObject.transform.parent.GetComponent <BoxCollider>())
     {
         return;
     }
     if (m_tetherState != stateType.Attached)
     {
         Debug.Log("Tether Attached to" + collider);
         m_tetherState    = stateType.Attached;
         m_attachedObject = collider.gameObject;
     }
 }
示例#2
0
    public void TryRetractTether(float retractTime)
    {
        if (m_tetherState == stateType.Retracting || m_startObject == null || m_tetherHook == null)
        {
            return;
        }

        float distanceToTarget = Vector3.Distance(m_startObject.transform.position, m_tetherDestination);

        if (m_tetherCurrentLength < distanceToTarget)
        {
            m_tetherDestination = m_tetherHook.transform.position;
        }

        m_tetherState          = stateType.Retracting;
        m_tetherAnimationStart = retractTime;
    }
示例#3
0
 public void ChangeState(stateType stateType)
 {
     m_tetherState = stateType;
 }