Exemplo n.º 1
0
    public void GetCharacter(GameObject Character, GameObject Manager)
    {
        this.Character = Character;
        this.Manager   = Manager;

        hubCharacterScript = Character.GetComponent <CharacterScript>();
        stats = Character.GetComponent <Stats>();

        Portrait.GetComponent <CharacterScript>().LoadPlayer(hubCharacterScript);
        Portrait.GetComponent <Stats>().LoadPlayer(stats);

        boxCharacterScript = Portrait.GetComponent <CharacterScript>();

        role = boxCharacterScript.role;
        if (role != null)
        {
            txtRole.text = role.roleName;
        }
        else
        {
            txtRole.text = "-No Role-";
        }
        PrepareAppoint();

        txtName.text = boxCharacterScript.title + boxCharacterScript.strName;

        SetStats();
        //boxCharacterScript.isEnlisted = false;
    }
Exemplo n.º 2
0
    public void GetRole(RoleObject role, GameObject Manager)
    {
        this.role    = role;
        this.Manager = Manager;

        roleTaken     = false;
        hubCharacters = GameObject.FindGameObjectsWithTag("Character");
        foreach (GameObject character in hubCharacters)
        {
            hubCharacterScript = character.GetComponent <CharacterScript>();
            if (hubCharacterScript.role == role)
            {
                stats = character.GetComponent <Stats>();

                Portrait.GetComponent <CharacterScript>().LoadPlayer(hubCharacterScript);
                Portrait.GetComponent <Stats>().LoadPlayer(stats);

                SetStats();
                hubCharacterScript.isEnlisted = false;
                roleTaken = true;
                break;
            }
        }
        if (!roleTaken)
        {
            //Destroy(Portrait);
            EmptyRole();
        }
    }
Exemplo n.º 3
0
    public void GetData(GameObject Character, GameObject DescParent, Text txtDescName, Text txtDescDesc)
    {
        this.Character  = Character;
        this.DescParent = DescParent;
        //this.txtDescName = txtDescName;
        //this.txtDescDesc = txtDescDesc;
        characterScript = Character.GetComponent <CharacterScript>();
        //txtName.text = characterScript.strName;

        Portrait.GetComponent <CharacterScript>().LoadPlayer(characterScript);
        Portrait.GetComponent <Stats>().LoadPlayer(Character.GetComponent <Stats>());

        PrepareSlots(); //Sätter det karaktären har på sig till slots i characterBox
    }
Exemplo n.º 4
0
    public void FinalInfo()
    {
        characterScript = Portrait.GetComponent <CharacterScript>();
        if (weaponSlot.GetComponentInChildren <ItemInfo>() != null)
        {
            rangedId = weaponSlot.GetComponentInChildren <ItemInfo>().id;
        }
        else
        {
            rangedId = "";
        }
        if (headSlot.GetComponentInChildren <ItemInfo>() != null)
        {
            headId = headSlot.GetComponentInChildren <ItemInfo>().id;
        }
        else
        {
            headId = "";
        }
        if (clothSlot.GetComponentInChildren <ItemInfo>() != null)
        {
            clothId = clothSlot.GetComponentInChildren <ItemInfo>().id;
        }
        else
        {
            clothId = "";
        }
        if (healingSlot.GetComponentInChildren <ItemInfo>() != null)
        {
            healingId = healingSlot.GetComponentInChildren <ItemInfo>().id;
        }
        else
        {
            healingId = "";
        }
        if (combatSlot.GetComponentInChildren <ItemInfo>() != null)
        {
            combatId = combatSlot.GetComponentInChildren <ItemInfo>().id;
        }
        else
        {
            combatId = "";
        }

        characterScript.rangedId = rangedId;

        if (headId != characterScript.headId)
        {
            if (headId == null || headId == "")
            {
                Portrait.GetComponent <PortraitScript>().RemoveHeadGear();
            }
            else
            {
                foreach (ClothItemObject cloth in Assets.assets.clothTemp)
                {
                    if (cloth.name == headId)
                    {
                        Portrait.GetComponent <PortraitScript>().ChangeCloth(cloth);
                    }
                }
            }
        }
        if (clothId != characterScript.clothId)
        {
            if (clothId == null || clothId == "")
            {
                Portrait.GetComponent <PortraitScript>().RemoveCloth();
            }
            else
            {
                foreach (ClothItemObject cloth in Assets.assets.clothTemp)
                {
                    if (cloth.name == clothId)
                    {
                        Portrait.GetComponent <PortraitScript>().ChangeCloth(cloth);
                    }
                }
            }
        }
        characterScript.healingId = healingId;
        characterScript.combatId  = combatId;
        //Updaterar characterScript;
    }