Exemplo n.º 1
0
    public void Open(ActorInfo Info)
    {
        this.gameObject.SetActive(true);

        CurrentCharacter = Info;

        if (CharSpot.childCount > 0)
        {
            Destroy(CharSpot.GetChild(0).gameObject);
        }

        GameObject charObject = Instantiate(ResourcesLoader.Instance.GetObject(CurrentCharacter.Gender == Gender.Male ? "actor_male" : "actor_female"));

        charObject.transform.SetParent(CharSpot);

        charObject.transform.position   = CharSpot.position;
        charObject.transform.localScale = Vector3.one;
        CharInstance = charObject.GetComponent <ActorInstance>();
        CharInstance.GetComponent <PlayerShortcuts>().enabled = false;

        CharInstance.Info       = CurrentCharacter;
        CharInstance.nameHidden = true;

        CharInstance.SetElementsLayer("OverUI", 2);

        RefreshEquipment();
    }
Exemplo n.º 2
0
    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();
    }