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 Personagem : MonoBehaviour
- {
- public InputField Name;
- public GameObject Uchihacla1, Sarutobicla2, Naracla3, NinjaShop, Loja;
- public GameObject[] UchihaSubClans, SarutobiSubClans, NaraSubClans;
- public Character _character;
- // 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 claName)
- {
- _character.clan = claName;
- _character.subclan = "";
- setAllToFalse();
- switch (claName)
- {
- case "Nara":
- NaraSubClans[0].SetActive(true);
- NaraSubClans[1].SetActive(true);
- break;
- case "Uchiha":
- UchihaSubClans[0].SetActive(true);
- UchihaSubClans[1].SetActive(true);
- break;
- case "Sarutobi":
- SarutobiSubClans[0].SetActive(true);
- SarutobiSubClans[1].SetActive(true);
- break;
- }
- }
- public void SetSubclan(string subclanName)
- {
- _character.subclan = subclanName;
- }
- private void setAllToFalse()
- {
- for (int i = 0; i < 2; i++)
- {
- UchihaSubClans[i].SetActive(false);
- SarutobiSubClans[i].SetActive(false);
- NaraSubClans[i].SetActive(false);
- }
- public void turnOffAll()
- {
- setAllToFalse();
- Uchihacla1.SetActive(false);
- Sarutobicla2.SetActive(false);
- Naracla3.SetActive(false);
- Name.gameObject.SetActive(false);
- NinjaShop.SetActive(false);
- Loja.SetActive(true);
- }
- }
- [System.Serializable]
- public class Character
- {
- public string name;
- public string clan;
- public string subclan;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement