Пример #1
0
    // sets next tutorial if possible, else finish
    public void SetNextTutorial(int currentOrder)
    {
        currentTutorial = GetTutorialByOrder(currentOrder);

        if (!currentTutorial)
        {
            CompletedAllTutorials();
            SetNextTutorial(0);
        }

        ExpText.text = Settings.MenuManager.LangManager.getString("PM0" + currentOrder + "");
    }
Пример #2
0
    private void Awake()
    {
        if (!PlayerPrefs.HasKey("VIBRATION"))
        {
            PlayerPrefs.SetInt("VIBRATION", 1);
            VibrationButton.GetComponent <Image>().sprite = on;
        }
        else
        {
            if (PlayerPrefs.GetInt("VIBRATION") == 1)
            {
                VibrationButton.GetComponent <Image>().sprite = on;
            }
            else
            {
                VibrationButton.GetComponent <Image>().sprite = off;
            }
        }
        currentLevel   = PlayerPrefs.GetInt("LevelId");
        LevelText.text = "Level " + currentLevel;
        if (PlayerPrefs.GetInt("FromMenu") == 1)
        {
            PlayerPrefs.SetInt("FromMenu", 0);
        }
        else
        {
            isGameStarted = true;
            switch (currentLevel)
            {
            case 2:
                Tutorial2.SetActive(true);
                break;

            case 3:
                Tutorial3.SetActive(true);
                break;

            default:
                break;
            }
            TapToStartButton.gameObject.SetActive(false);
        }
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        tut = FindObjectOfType <Tutorial3>();
        OnValidate();
        Cursor.lockState = CursorLockMode.Locked;
        canBuild         = false;
        intialMoveSpeed  = moveSpeed;
        rb             = GetComponent <Rigidbody>();
        rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY;

        cam          = Camera.main;
        camTransform = cam.transform;
        pivot        = GameObject.FindGameObjectWithTag("pivot");
        ip           = FindObjectOfType <itemPlacer>();
        crosshair    = GameObject.Find("Cross Hair");

        //pickRandomTowers(5);
        isBuilding         = true;
        combinesRecognized = false;
    }
Пример #4
0
    public void TapToStartButtonClick()
    {
        isGameStarted = true;
        switch (currentLevel)
        {
        case 1:
            Tutorial1.SetActive(true);
            break;

        case 2:
            Tutorial2.SetActive(true);
            break;

        case 3:
            Tutorial3.SetActive(true);
            break;

        default:
            break;
        }
    }
Пример #5
0
    private void Update()
    {
        if (isGameEnd || !isGameStarted)
        {
            return;
        }
        if (cubeManager.CubesWillBeDestroyed.Count == 0)
        {
            isGameEnd = true;
            cubeManager.ColorAllCubes();
            switch (currentLevel)
            {
            case 1:
                Tutorial1.SetActive(false);
                break;

            case 2:
                Tutorial2.SetActive(false);
                break;

            case 3:
                Tutorial3.SetActive(false);
                break;

            default:
                break;
            }
            StartCoroutine(WaitAndGameWin());
            Debug.Log("<color=green/>Game Win</color>");
        }
        else if (live <= 0)
        {
            isGameEnd = true;
            switch (currentLevel)
            {
            case 1:
                Tutorial1.SetActive(false);
                break;

            case 2:
                Tutorial2.SetActive(false);
                break;

            case 3:
                Tutorial3.SetActive(false);
                break;

            default:
                break;
            }
            StartCoroutine(WaitAndGameLose());
        }
        if (Input.GetMouseButton(0))
        {
            if (ContinueTutorial.activeSelf)
            {
                counter = 0;
                ContinueTutorial.SetActive(false);
            }
        }
        else
        {
            counter += Time.deltaTime;
            if (counter >= 5f)
            {
                if (!ContinueTutorial.activeSelf)
                {
                    ContinueTutorial.SetActive(true);
                }
            }
        }
    }