Ejemplo n.º 1
0
 private void FindSelectedSkill()
 {
     for (int index = 0; index < skillSlots.Count; index++)
     {
         if (skillSlots[index] == eventSys.currentSelectedGameObject)
         {
             selectedSkill = turnBaseScript.currentTurnCharacter.baseStatus.skills[index];
             return;
         }
     }
 }
Ejemplo n.º 2
0
    // Function to initialize the magic data prefab
    public void InitializeSkillData(GameObject skillObject, SkillScriptable skillScriptable, GameObject currentUser, GameObject targetUser)
    {
        // Set sorting layers
        skillObject.GetComponent <SpriteRenderer>().sortingLayerName = "Battle Characters";
        skillObject.GetComponent <SpriteRenderer>().sortingOrder     = 2;

        // Set appropriate skill properties
        skillObject.GetComponent <SkillProperties>().skillName          = skillScriptable.skillName;
        skillObject.GetComponent <SkillProperties>().skillDescription   = skillScriptable.skillDescription;
        skillObject.GetComponent <SkillProperties>().skillCost          = skillScriptable.skillCost;
        skillObject.GetComponent <SkillProperties>().skillDamage        = skillScriptable.skillDamage;
        skillObject.GetComponent <SkillProperties>().skillSprite        = skillScriptable.skillSprite;
        skillObject.GetComponent <SkillProperties>().effectLength       = skillScriptable.effectLength;
        skillObject.GetComponent <SkillProperties>().soundEffect        = skillScriptable.soundEffect;
        skillObject.GetComponent <SkillProperties>().skillAnimation     = skillScriptable.skillAnimation;
        skillObject.GetComponent <SkillProperties>().isHealingSkill     = skillScriptable.isHealingSkill;
        skillObject.GetComponent <Animator>().runtimeAnimatorController = skillScriptable.skillAnimation;

        // Set current and target user
        skillObject.GetComponent <SkillProperties>().currentUser = currentUser;
        skillObject.GetComponent <SkillProperties>().targetUser  = targetUser;
    }