MainScript.Start C# (CSharp) Method

Start() private method

private Start ( ) : void
return void
    void Start()
    {
        bottomMenu = GetComponent<GUIBottomMenu>();
        if(!bottomMenu) {

            // DEBUG
            Debug.LogError("Bottom menu object not found!");
        }

        player = playerObject.GetComponent<CPlayer>();
        if(!player) {

            // DEBUG
            Debug.LogError("Player object not found!");
        }

        fTaxaConsumoOxigenio = 1.0f;
        fTaxaExtract = 1.0f;
        fTaxaFabrica = 1.0f;

        GetCurrentUnitsInScene();

        mouseInputScript = gameObject.GetComponent<MouseWorldPosition>();
        if(!mouseInputScript) {

            // DEBUG
            Debug.LogError("Cannot find the MouseWorldPosition component. Please check.");
        }

        questManager = gameObject.GetComponent<QuestManager>();
        if(!questManager) {

            // DEBUG
            Debug.LogError("Cannot find the QuestManager component. Please check.");
        }

        //Instantiate(GameObject.("Monkey"), new Vector3(79.07609f,33.39249f,13.41692f), Quaternion.identity);

        // Get all the monkeys in the scene and assign their objects to some variables, so we have shortcuts to them
        GetMonkeysObjects();
    }

Usage Example

Exemplo n.º 1
0
    public void ClickUp()
    {
        Time.timeScale = 1;

        FindBalls(transform);

        for (int i = 0; i < BallsContant.Count; i++)
        {
            FindBalls(BallsContant[i].transform);
        }

        if (BallsContant.Count >= 3)
        {
            foreach (var balls in BallsContant)
            {
                Destroy(balls.gameObject);
            }


            main.ScorePlus += BallsContant.Count;

            PlayerPrefs.SetInt("Score", main.Score);

            main.BallCount += BallsContant.Count;
            main.Start();
        }
        else
        {
            BallsContant.Clear();
        }
    }