Example #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Hand"))
     {
         askState = AskState.Close;
     }
 }
Example #2
0
 private void OnTriggerEnter(Collider other)
 {
     // when the user hand trigger the inventory collider, ask for open it
     // we do not want break current animation by calling directly OpenInventory or CloseInventory
     if (other.CompareTag("Hand"))
     {
         askState = AskState.Open;
     }
 }
Example #3
0
    private void Update()
    {
        if (isInAnimation || askState == AskState.None)
        {
            return;
        }

        if (askState == AskState.Open)
        {
            OpenInventory();
        }
        else
        {
            CloseInventory();
        }

        askState = AskState.None;
    }