Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class CharacterManager : MonoBehaviour {
- public InputField name;
- public Character _character;
- public GameObject FogoBTN, AguaBTN, TerraBTN, EnviarLoja, Loja;
- public GameObject[] FogoSubClans, AguaSubClans, TerraSubClans;
- // Use this for initialization
- void Start ()
- {
- _character = new Character();
- }
- // Update is called once per frame
- void Update ()
- {
- _character.name = name.text;
- }
- public void SetClan (string clanName)
- {
- _character.clan = clanName;
- _character.subclan = "";
- setAllToFalse();
- }
- public void turnOffAll()
- {
- setAllToFalse();
- FogoBTN.SetActive(false);
- AguaBTN.SetActive(false);
- TerraBTN.SetActive(false);
- name_.gameObject.SetActive(false);
- SendBTN.SetActive(false);
- Shop.SetActive(true);
- }
- switch (clanName)
- {
- {
- case "Fogo":
- FogoSubClans[0].SetActive(true);
- FogoSubClans[1].SetActive(true);
- break;
- case "Agua":
- AguaSubClans[0].SetActive(true);
- AguaSubClans[1].SetActive(true);
- break;
- case "Terra":
- TerraSubClans[0].SetActive(true);
- TerraSubClans[1].SetActive(true);
- break;
- }
- }
- public void SetSubclan(string subclanName) {
- _character.subclan = subclanName;
- }
- private void setAllToFalse() {
- for(int i = 0; i < 2; i++) {
- FogoSubClans[i].SetActive(false);
- AguaSubClans[i].SetActive(false);
- TerraSubClans[i].SetActive(false);
- }
- }
- }
- [System.Serializable]
- public class Character
- {
- public string name;
- public string clan;
- public string subclan;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement