public void ToggleGender() { m_ActorInstance.gameObject.SetActive(false); GameObject tempObj; if (m_ActorInfo.Gender == Gender.Male) { m_ActorInfo.Gender = Gender.Female; tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_female")); m_ActorInfo.Hair = AllowedHairFemale[0]; } else { m_ActorInfo.Gender = Gender.Male; tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_male")); m_ActorInfo.Hair = AllowedHairMale[0]; } tempObj.transform.SetParent(transform); tempObj.transform.position = actorSpot.position; tempObj.transform.localScale = actorSpot.localScale; m_ActorInstance = tempObj.GetComponent <ActorInstance>(); m_ActorInstance.Info = m_ActorInfo; m_ActorInstance.nameHidden = true; m_ActorInstance.UpdateVisual(); m_txtGender.text = m_ActorInfo.Gender.ToString(); }
public void Load(ActorInfo info) { if (Actor != null) { Actor.gameObject.SetActive(false); } GameObject tempObj; if (info.Gender == Gender.Male) { tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_male")); } else { tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_female")); } tempObj.transform.SetParent(transform); tempObj.transform.position = actorSpot.position; tempObj.transform.localScale = actorSpot.localScale; Actor = tempObj.GetComponent <ActorInstance>(); Actor.nameHidden = true; Actor.UpdateVisual(info); txtName.text = info.Name; txtInfo.text = "LVL " + info.LVL; }
public void SetInfo(ActorInfo info) { if (actorInstance != null) { actorInstance.gameObject.SetActive(false); } GameObject tempObj; if (info.Gender == Gender.Male) { tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_male")); } else { tempObj = Instantiate(ResourcesLoader.Instance.GetObject("actor_female")); } tempObj.transform.SetParent(transform); tempObj.transform.position = actorSpot.position; tempObj.transform.localScale = actorSpot.localScale; actorInstance = tempObj.GetComponent <ActorInstance>(); actorInstance.nameHidden = true; actorInstance.UpdateVisual(info); txtName.text = info.Name; txtLevel.text = "Level " + info.LVL; LocalUserInfo.Me.ClientCharacter = info; }
public void RefreshEquipment() { if (CurrentCharacter != null) { HeadSlot.SetData(CurrentCharacter.Equipment.Head, this); ChestSlot.SetData(CurrentCharacter.Equipment.Chest, this); GlovesSlot.SetData(CurrentCharacter.Equipment.Gloves, this); LegsSlot.SetData(CurrentCharacter.Equipment.Legs, this); ShoesSlot.SetData(CurrentCharacter.Equipment.Shoes, this); WeaponSlot.SetData(CurrentCharacter.Equipment.Weapon, this); CharInstance.UpdateVisual(); } }
private IEnumerator RefreshRoutine(ActorInfo Info) { m_txtName.text = Info.Name; m_txtGender.text = "Gender: " + Info.Gender.ToString(); m_txtLevel.text = "Level: " + Info.LVL; m_btnAddFriend.interactable = false; m_btnAddParty.interactable = CanSendPartyInvite(Info.Name); if (CharSpot.childCount > 0) { Destroy(CharSpot.GetChild(0).gameObject); } yield return(0); if (Info.Gender == Gender.Male) { Instantiate(ResourcesLoader.Instance.GetObject("actor_male")).transform.SetParent(CharSpot); } else { Instantiate(ResourcesLoader.Instance.GetObject("actor_female")).transform.SetParent(CharSpot); } CharSpot.GetChild(0).position = CharSpot.position; CharSpot.GetChild(0).transform.localScale = Vector3.one; CharInstance = CharSpot.GetChild(0).GetComponent <ActorInstance>(); CharInstance.GetComponent <PlayerShortcuts>().enabled = false; CharInstance.Info = Info; CharInstance.nameHidden = true; CharInstance.SetElementsLayer("OverUI", 1); CharInstance.UpdateVisual(); }
public void NextHair() { hairIndex++; if (m_ActorInfo.Gender == Gender.Male) { if (hairIndex >= AllowedHairMale.Count) { hairIndex = 0; } } else { if (hairIndex >= AllowedHairFemale.Count) { hairIndex = 0; } } if (m_ActorInfo.Gender == Gender.Male) { m_ActorInfo.Hair = AllowedHairMale[hairIndex]; } else { m_ActorInfo.Hair = AllowedHairFemale[hairIndex]; } m_ActorInstance.UpdateVisual(); }