Esempio n. 1
0
 public void FlipTile() //When you press A after opening the flip grid
 {
     if (selectedTile)
     {
         playerControlsManager.ToggleOnGenericUI();
         currentTile = groundTilemap.GetTile(new Vector3Int((int)(selectedTile.transform.position.x - 0.5f), (int)(selectedTile.transform.position.y - 0.5f), (int)selectedTile.transform.position.z)) as GroundTile;
         if (currentTile)
         {
             //darkOverlayObject = Instantiate(darkOverlayPrefab, transform);
             encounterManager.TestGroundType(currentTile.groundType, selectedTile, false);
         }
         else
         {
             GameObject colliding = testTrigger.GetCollidingGameObject();
             if (testTrigger.GetCollidingTileableStatus())
             {
                 if (colliding.GetComponent <IInteractable>() != null)
                 {
                     colliding.GetComponent <IInteractable>().Interact();
                 }
                 GroundType tmpType = colliding.GetComponent <TTileable>().GetTileType();
                 //darkOverlayObject = Instantiate(darkOverlayPrefab, transform);
                 encounterManager.TestGroundType(tmpType, selectedTile, false);
             }
         }
     }
 }
Esempio n. 2
0
    IEnumerator ShortWait(GameObject firstSlot)
    {
        yield return(new WaitForEndOfFrame());

        playerControlsManager.ToggleOnGenericUI();
        eventSystem.SetSelectedGameObject(firstSlot);
        playerControlsManager.onCancelGenericUICallback += CancelBerry;
    }
Esempio n. 3
0
    public IEnumerator TeleportPlayer(Vector3 newCoords, Vector2 newDirection)
    {
        NotWalking();
        move.x                       = 0;
        move.y                       = 0;
        transform.position           = newCoords;
        currentDirection             = newDirection;
        movePoint.transform.position = newCoords;
        inFrontOfPlayerTrigger.transform.position = newCoords;
        playerControlsManager.ToggleOnGenericUI();
        yield return(new WaitForEndOfFrame());

        yield return(new WaitForEndOfFrame());

        playerControlsManager.ToggleOffGenericUI();
    }