Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        pointsLeft       = totalPoints;
        attackSlices     = GameObject.FindGameObjectWithTag("AttackSlices");
        defenseSlices    = GameObject.FindGameObjectWithTag("DefenseSlices");
        healthSlices     = GameObject.FindGameObjectWithTag("HealthSlices");
        wealthSlices     = GameObject.FindGameObjectWithTag("WealthSlices");
        alert            = GameObject.FindGameObjectWithTag("NewGameAlert");
        inputName        = GameObject.FindGameObjectWithTag("InputName").GetComponent <TextMeshProUGUI>();
        pointsLeftUI     = GameObject.FindGameObjectWithTag("PointsLeft").GetComponent <TextMeshProUGUI>();
        gameDataManager  = GameObject.FindGameObjectWithTag("GameData").GetComponent <GameDataManager>();
        globalButton     = GameObject.FindGameObjectWithTag("MenuGlobalButton").GetComponent <MenuGlobalButton>();
        attributeButtons = GameObject.FindGameObjectsWithTag("NewGameButton");
        alertButtons     = GameObject.FindGameObjectsWithTag("NewGameAlertButton");
        myEventSystem    = GameObject.Find("EventSystem").GetComponent <EventSystem>();

        pointsLeftUI.SetText(pointsLeft.ToString());
        backUp = pointsLeftUI.color;

        alert.SetActive(false);

        attackValue  = 1;
        defenseValue = 1;
        healthValue  = 1;
        wealthValue  = 1;

        for (int i = 0; i < attackSlices.transform.childCount; i++)
        {
            if (i > 0)
            {
                attackSlices.transform.GetChild(i).gameObject.SetActive(false);
            }
        }

        for (int i = 0; i < defenseSlices.transform.childCount; i++)
        {
            if (i > 0)
            {
                defenseSlices.transform.GetChild(i).gameObject.SetActive(false);
            }
        }

        for (int i = 0; i < healthSlices.transform.childCount; i++)
        {
            if (i > 0)
            {
                healthSlices.transform.GetChild(i).gameObject.SetActive(false);
            }
        }

        for (int i = 0; i < wealthSlices.transform.childCount; i++)
        {
            if (i > 0)
            {
                wealthSlices.transform.GetChild(i).gameObject.SetActive(false);
            }
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (!transform.name.Equals("Back Button"))
        {
            loadMenu        = transform.GetComponentInParent <LoadMenu>();
            saveNumber      = Convert.ToInt32(transform.parent.transform.name.Substring(5));
            gameDataManager = GameObject.FindGameObjectWithTag("GameData").GetComponent <GameDataManager>();
        }

        pointer      = GameObject.FindGameObjectWithTag("Pointer");
        globalButton = GameObject.FindGameObjectWithTag("MenuGlobalButton").GetComponent <MenuGlobalButton>();


        if (!transform.name.Equals("Back Button"))
        {
            for (int i = 0; i < transform.parent.childCount; i++)
            {
                if (transform.parent.GetChild(i).transform.CompareTag("NotEmptySave"))
                {
                    notEmpty = transform.parent.GetChild(i).gameObject;
                }
                else if (transform.parent.GetChild(i).CompareTag("EmptySave"))
                {
                    empty = transform.parent.GetChild(i).gameObject;
                }
                else if (transform.parent.GetChild(i).CompareTag("LoadMenuSelected"))
                {
                    selected = transform.parent.GetChild(i).gameObject;
                }
            }

            for (int i = 0; i < notEmpty.transform.childCount; i++)
            {
                if (notEmpty.transform.GetChild(i).CompareTag("LoadMenuName"))
                {
                    playerName = notEmpty.transform.GetChild(i).GetComponent <TextMeshProUGUI>();
                }

                else if (notEmpty.transform.GetChild(i).CompareTag("LoadMenuAttributes"))
                {
                    attributes = notEmpty.transform.GetChild(i).gameObject;
                }
            }

            selected.SetActive(false);
            Invoke("checkSavedGame", 0.001f);
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        pointer      = GameObject.FindGameObjectWithTag("Pointer");
        globalButton = GameObject.FindGameObjectWithTag("MenuGlobalButton").GetComponent <MenuGlobalButton>();

        if (!transform.name.Equals("Back Button"))
        {
            for (int i = 0; i < transform.parent.childCount; i++)
            {
                if (transform.parent.GetChild(i).CompareTag("OptionsSelected"))
                {
                    selected = transform.parent.GetChild(i).gameObject;
                }
            }

            selected.SetActive(false);
        }
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        pointer      = GameObject.FindGameObjectWithTag("Pointer");
        globalButton = GameObject.FindGameObjectWithTag("MenuGlobalButton").GetComponent <MenuGlobalButton>();

        if (transform.CompareTag("NewGameButton"))
        {
            for (int i = 0; i < transform.parent.childCount; i++)
            {
                if (transform.parent.GetChild(i).CompareTag("NewGameSelected"))
                {
                    selected = transform.parent.GetChild(i).gameObject;
                }
            }

            if (selected != null)
            {
                selected.SetActive(false);
            }
        }
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     pointer      = GameObject.FindGameObjectWithTag("Pointer");
     globalButton = GameObject.FindGameObjectWithTag("MenuGlobalButton").GetComponent <MenuGlobalButton>();
 }