Exemplo n.º 1
0
    public void ChangeOwnership(int ID)
    {
        IInteractable       interactable = InteractableFactory.Instance.GetInteractable(ID);
        InteractableVisible visible      = interactable.GetComponent <InteractableVisible>();

        if (visible.visiblePlayer == VisiblePlayer.PLAYER_1)
        {
            visible.visiblePlayer = VisiblePlayer.PLAYER_2;
        }
        else if (visible.visiblePlayer == VisiblePlayer.PLAYER_2)
        {
            visible.visiblePlayer = VisiblePlayer.PLAYER_1;
        }
        visible.recheckVisible();
        GetComponent <PickingThings>().toPickUp = null;
        GameObject endChecker = GameObject.Find("EndChecker");

        if (endChecker != null)
        {
            EndChecker endCheckerScript = endChecker.GetComponent <EndChecker>();
            if (endCheckerScript.isEnd())
            {
                endCheckerScript.endPopup.SetActive(true);
            }
        }
    }
Exemplo n.º 2
0
 private void checkVisibility()
 {
     GameObject[] gos = GameObject.FindGameObjectsWithTag("interactable");
     foreach (GameObject go in gos)
     {
         InteractableVisible iv = go.GetComponent <InteractableVisible>();
         if (iv == null)
         {
             continue;
         }
         iv.recheckVisible();
     }
 }