public void move()
    {
        position.x = x;
        position.y = y;

        player.setPosition(position);

        player.prepareSprite();
        player.unFreeze();
    }
Example #2
0
    private void Update()
    {
        if (active)
        {
            player.setFreeze();
            background.SetActive(true);

            timer -= 0.1f;
            if (timer <= 0 && index < letters.Length)
            {
                timer         += 1f;
                tempLine      += letters[index];
                textKupla.text = tempLine;
                index         += 1;
            }
            else if (Input.GetKeyDown("space") && index >= letters.Length)
            {
                lineRound += 1;

                if (lineRound >= showExBg && lineRound <= endExBg)
                {
                    extraBackground.SetActive(true);
                }
                else if (extraBackground != null)
                {
                    extraBackground.SetActive(false);
                }

                if (lineRound < line.Length)
                {
                    index          = 0;
                    textKupla.text = "";
                    tempLine       = null;
                    letters        = null;
                    letters        = line[lineRound].ToCharArray();
                    timer         += 1f;
                }
                else if (lineRound >= line.Length)
                {
                    textKupla.text = "";
                    player.unFreeze();
                    background.SetActive(false);

                    if (isFlyer)
                    {
                        ProgressControlScript.Instance.setFlyer();
                    }
                    else if (isTryingOut)
                    {
                        ProgressControlScript.Instance.setTryingOut();
                    }

                    Destroy(this);
                }
            }
        }
    }
    private void OnTriggerStay2D(Collider2D coll)
    {
        PlayerCharacterScript controller = coll.GetComponent <PlayerCharacterScript>();

        if (controller != null && destruct)
        {
            controller.levelUp();
            controller.unFreeze();
            Destroy(gameObject);
        }
    }