Esempio n. 1
0
 void Start()
 {
     sentences = new Queue <string>();
     if (GetOfGameObj.get() == 3)
     {
         dt.TriggerDialogue();
     }
 }
Esempio n. 2
0
    public void Restart()
    {
        int b;

        b = GetOfGameObj.get();

        // SceneManager.GetActiveScene();
        SceneManager.LoadScene(b);
    }
Esempio n. 3
0
 public void EndDialogue()
 {
     if (GetOfGameObj.get() == 1)
     {
         animator.SetBool("IsOpen", false);
         ButLearn.gameObject.SetActive(false);
         ButSkip.gameObject.SetActive(false);
         ButtNext.gameObject.SetActive(false);
     }
     else
     {
         animator.SetBool("IsOpen", false);
     }
 }
Esempio n. 4
0
    public void isEndGame()
    {
        int sceneIndex = GetOfGameObj.get();
        int scenceNext = FindOfIndexScenceNext.get_next();

        if (scenceNext != 0)
        {
            PlayerPrefs.SetInt("LevelComplete", sceneIndex);
        }
        else
        {
            Invoke("NextLvl", 2f);
        }
    }
Esempio n. 5
0
    void Start()
    {
        int corrent_level = GetOfGameObj.get();

        if (instance == null)
        {
            instance = this;
        }

        sceneIndex = GetOfGameObj.get();
        if (corrent_level != 0)
        {
            levelComplete = PlayerPrefs.GetInt("LevelComplete");
        }
    }
Esempio n. 6
0
    void Update()
    {
        if (!is_game_over)
        {
            if (!PlInt.stop_boy)
            {
                if (Input.GetButtonDown("Horizontal"))
                {
                    timeSinceLastTab = Time.time - LAstTabTime;
                }

                if (Input.GetButtonUp("Horizontal"))
                {
                    speed            = first_speed;
                    is_fast          = false;
                    timeSinceLastTab = 1;
                }

                if (GetOfGameObj.get() == 3 && (timeSinceLastTab <= DOUBLE_TIME))
                {
                    Debug.Log("Time Les" + timeSinceLastTab);
                    Debug.Log("Time more" + DOUBLE_TIME);
                    speed   = new Vector2(2, 1.5f);
                    is_fast = true;
                }
                else
                {
                    Debug.Log("Sped doesn't change");
                    speed   = first_speed;
                    is_fast = false;
                }

                float inputX = Input.GetAxis("Horizontal");
                float inputY = Input.GetAxis("Vertical");

                if (Input.GetButtonDown("Horizontal") || Input.GetButtonDown("Vertical"))
                {
                    armComp.animation.Play("walk", 0);
                    LAstTabTime = Time.time;
                }
                if ((Input.GetButtonUp("Horizontal") && (!Input.GetButtonDown("Vertical") && !Input.GetButton("Vertical") && !Input.GetButton("Horizontal"))) || (Input.GetButtonUp("Vertical") && (!Input.GetButton("Horizontal") && !Input.GetButtonDown("Horizontal") && !Input.GetButton("Vertical"))))
                {
                    armComp.animation.Play("stop", 0);
                }

                movement = new Vector2(
                    speed.x * inputX,
                    speed.y * inputY);
                if (inputX > 0 && !isFacingRight)
                {
                    //отражаем персонажа вправо
                    Flip();
                }
                //обратная ситуация. отражаем персонажа влево
                else if (inputX < 0 && isFacingRight)
                {
                    Flip();
                }
                movement = new Vector2(speed.x * inputX, speed.y * inputY);
            }
            else
            {
                movement = new Vector2(0, 0);
            }
        }
        else
        {
            movement    = new Vector2(0, 0);
            rb.velocity = movement;
            armComp.animation.Stop("stop");
            armComp.animation.Stop("walk");
            if (!armComp.animation.isPlaying)
            {
                armComp.animation.Play("cry");
            }

            Invoke("Lose", 2f);
        }
    }
Esempio n. 7
0
 public void Awake()
 {
     GetOfGameObj.set(index);
     FindOfIndexScenceNext.set_next(next_index);
 }