Example #1
0
 // Use this for initialization
 void Awake()
 {
     _character = GameObject.FindWithTag("Player");
     // characterCam = GameObject.FindWithTag("MainCamera");
     _characterRigidbody     = _character.GetComponent <Rigidbody>();
     _thirdPersonUserControl = _character.GetComponent <ThirdPersonUserControl>();
     _balance = FindObjectOfType <RopeBalance>();
 }
    void OnTriggerEnter(Collider other)
    {
        if (!other.CompareTag("Player"))
        {
            return;
        }

        // Am I alreayd doing things? If so don't start again but stop doing the balance
        RopeBalance balance = FindObjectOfType <RopeBalance>();

        if (false == balance.isBalancing)
        {
            balance.BeginBalance(transform, otherEnd);
        }
        else
        {
            balance.EndBalance();
        }
    }