//====================================================== Character Selection public void ChangeCharacterPreview(int id) { SOCharacter _char = GameManager.Instance.characterDictionary.characters[id]; _charTexts[0].text = _char.name; _charTexts[1].text = _char.descrition; _charTexts[2].text = _char.spellDescriptions[0]; _charTexts[3].text = _char.spellDescriptions[1]; _charTexts[4].text = _char.spellDescriptions[2]; // change icons if (_char.icons.Length >= 3) { for (int i = 0; i < _abilityIcons.Length; i++) { _abilityIcons[i].sprite = _char.icons[i]; } } // check if char is already selected _selectButton.onClick.RemoveAllListeners(); if (id != GameManager.Instance.charId) { _charTexts[5].text = "Select"; _selectButton.interactable = true; _selectButton.onClick.AddListener(() => GameManager.Instance.SetCharacterId(id)); } else { _charTexts[5].text = "Selected"; _selectButton.interactable = false; } }
public void setStats(SOCharacter c) { character = c; speedStat = c.speed; intelligenceStat = c.intelligence; dexterityStat = c.dexterity; luckStat = c.luck; profilePic = c.characterSprite; }
public void GetDroppedItem() { if (occupier != null) { objectName = occupier.name; SOCharacter c = null; switch (objectName) { case "Ali": c = Resources.Load("Scripts/ScriptableObjects/Ali") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Ezra": c = Resources.Load("Scripts/ScriptableObjects/Ezra") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Francisco": c = Resources.Load("Scripts/ScriptableObjects/Francisco") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Josie": c = Resources.Load("Scripts/ScriptableObjects/Josie") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Kwame": c = Resources.Load("Scripts/ScriptableObjects/Kwame") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Selma": c = Resources.Load("Scripts/ScriptableObjects/Selma") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Soleil": c = Resources.Load("Scripts/ScriptableObjects/Soleil") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; case "Vanna": c = Resources.Load("Scripts/ScriptableObjects/Vanna") as SOCharacter; BuildTeam.instance.SetCrewmember(c, transform.name); break; } } else { Debug.Log(transform.name + " is empty"); } }
private void DialogSetAvatar(SOCharacter character) { DialogToolbar.SetActive(true); if (character.IdleAnimationClip) { DialogAvatar.GetComponent <Animator>().Play("Base Layer." + character.IdleAnimationClip.name); } else { DialogAvatar.GetComponent <Image>().overrideSprite = character.avatar; } }
private void Awake() { Instance = GetComponent <PlayerManager>(); if (_debug == false) { _char = _characters.characters[GameManager.Instance.charId]; } else if (_debug == true) { _char = _characters.characters[_charId]; } SpawnPlayer(); }
// constructor sets team name and sets characters to their positions // it also calls setTeamStats() to set stats based on chosen characters public Team(string name, SOCharacter c, SOCharacter p, SOCharacter m, SOCharacter g) { teamName = name; captain = c; pilot = p; mechanic = m; gunner = g; SetTeamStats(); instance = this; // can be called to create a file to show the team stats //SaveTeam(); //ReadTeam(); }
public void SetCrewmember(SOCharacter character, string slotName) { switch (slotName) { case "CaptainSlot": captain = character; break; case "MechanicSlot": mechanic = character; break; case "PilotSlot": pilot = character; break; case "GunnerSlot": gunner = character; break; } }
public void SetCharacter(SOCharacter c) { setStats(c); transform.Find("ProfilePic").GetComponent <SpriteRenderer>().sprite = profilePic; }