private void OnDisable()
 {
     if (_controls != null)
     {
         _controls.Disable();
     }
 }
Exemplo n.º 2
0
    public IEnumerator Warp(Vector2 position)
    {
        Inputs.Disable("start");
        Inputs.disableDpad();
        isMoving = false;
        WaitForSeconds wait = new WaitForSeconds(0.1f);

        for (int i = 0; i < 3; i++)
        {
            yield return(wait);

            ScreenEffects.flashLevel--;
        }
        yield return(new WaitForSeconds(0.25f));

        transform.position = position;
        targetPos          = transform.position;

        ScreenEffects.flashLevel = 3;
        yield return(wait);

        ScreenEffects.flashLevel = 0;

        Inputs.Enable("start");
        Inputs.enableDpad();
        isWarping = false;
        CheckCollision();

        MapTile currentTile = new MapTile(new Vector3Int((int)transform.position.x, (int)transform.position.y, 0));

        if (currentTile.hasTile && onWarpTile && currentWarpTile.forceMove)
        {
            StartCoroutine(MovePlayerOneTile(direction));
        }
    }
Exemplo n.º 3
0
    public IEnumerator PlayDialogue()
    {
        if (Player.instance.direction == Direction.Left || Player.instance.direction == Direction.Right)
        {
            if (GameData.instance.coins > 0)
            {
                Dialogue.instance.keepTextOnScreen = true;
                yield return(Dialogue.instance.text("A slot machine!\\lWant to play?"));

                yield return(StartCoroutine(Dialogue.instance.prompt()));

                if (Dialogue.instance.selectedOption == 0)
                {
                    Dialogue.instance.Deactivate();
                    yield return(StartCoroutine(Player.instance.DisplayEmotiveBubble(1)));

                    Player.disabled = true;
                    GameDataManager.instance.slots.gameObject.SetActive(true);
                    Inputs.Disable("start");
                    StartCoroutine(Slots.instance.Initialize());
                }
                else
                {
                    Dialogue.instance.Deactivate();
                }
            }
            else
            {
                yield return(Dialogue.instance.text("You don't have any\\lcoins!"));
            }
        }
    }
Exemplo n.º 4
0
 public void Init()
 {
     GameData.instance.atTitleScreen = true;
     Inputs.Disable("start");
     Player.disabled = true;
     Title.instance.animationsFinished = false;
     Player.instance.GetComponent <BoxCollider2D>().enabled = false;
 }
Exemplo n.º 5
0
 private void OnDisable()
 {
     if (_inputs == null)
     {
         return;
     }
     _inputs.Disable();
 }
Exemplo n.º 6
0
 void OnDisable()
 {
     Debug.Log("OnDisable");
     // Checa se está rodando para executar o disable
     if (Application.isPlaying || EditorApplication.isPlaying)
     {
         inputs.Disable();
     }
 }
Exemplo n.º 7
0
    public IEnumerator PlayDialogue()
    {
        Dialogue.instance.Deactivate();
        yield return(Dialogue.instance.text(GameData.instance.playerName + " turned on\\lthe PC!"));

        Player.instance.menuActive = true;
        PC.instance.gameObject.SetActive(true);
        Inputs.Disable("start");
        StartCoroutine(PC.instance.Initialize());
    }
Exemplo n.º 8
0
 private void OnDisable()
 {
     inputs.Disable();
 }
Exemplo n.º 9
0
 void OnDisable()
 {
     gameInputs.Disable();
 }
Exemplo n.º 10
0
 private void OnDisable()
 {
     inputActions.Disable();
 }
Exemplo n.º 11
0
 void OnDisable() => inputs.Disable();
Exemplo n.º 12
0
 private void OnDisable()
 {
     _controls.Disable();
 }
Exemplo n.º 13
0
    // Update is called once per frame
    void Update()
    {
        if (currentmenu == null)
        {
            cursor.SetActive(false);
        }
        else if (currentmenu == thismenu)
        {
            playername.text = GameData.instance.playerName;
            cursor.SetPosition(88, 120 - 16 * selectedOption);



            if (Inputs.pressed("down"))
            {
                selectedOption++;
            }
            if (Inputs.pressed("up"))
            {
                selectedOption--;
            }
            if (selectedOption < 0)
            {
                selectedOption = slotNumber - 1;
            }
            if (selectedOption == slotNumber)
            {
                selectedOption = 0;
            }
        }


        if (Inputs.pressed("start"))
        {
            if (currentmenu == thismenu)
            {
                Close();
            }
        }

        if (Inputs.pressed("a"))
        {
            if (currentmenu == thismenu)
            {
                SoundManager.instance.PlayABSound();
                if (selectedOption == 0)
                {
                    currentmenu = pokedexmenu;
                    pokedexmenu.SetActive(true);
                    Inputs.Disable("start");
                    pokedex.Init();
                }
                if (selectedOption == 1)
                {
                    currentmenu             = pokemonmenu;
                    pokemonMenu.currentMenu = pokemonMenu.mainwindow;
                    Inputs.Disable("start");
                    pokemonMenu.selectedOption = 0;
                    pokemonmenu.SetActive(true);
                    pokemonMenu.Initialize();
                }
                if (selectedOption == 2)
                {
                    bag.Initialize();
                    bag.selectBag = -1;
                    currentmenu   = Bagmenu;
                    cursor.SetActive(true);
                    Bagmenu.SetActive(true);
                    Inputs.Disable("start");
                }

                if (selectedOption == 3)
                {
                    currentmenu = badgesmenu;
                    cursor.SetActive(false);
                    Inputs.Disable("start");
                    badgesmenu.GetComponent <Badges>().Init();
                    badgesmenu.SetActive(true);
                }
                if (selectedOption == 4)
                {
                }
                if (selectedOption == 5)
                {
                    options.Init();

                    optionsmenu.SetActive(true);
                    Inputs.Disable("start");
                    currentmenu = optionsmenu;
                }
                if (selectedOption == 6)
                {
                    Close();
                }
            }
        }
        if (Inputs.pressed("b"))
        {
            if (currentmenu == thismenu)
            {
                SoundManager.instance.PlayABSound();
                Close();
            }
        }
    }
Exemplo n.º 14
0
 void OnDisable()
 {
     inputs.Disable();
 }
Exemplo n.º 15
0
 //Required for new Input system
 public void OnDisable()
 {
     controls.Disable();
 }