58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
/*
|
|
사용법:
|
|
Project에서 Create → Skill/SkillData로 스킬 에셋 생성, 레벨별 수치 입력
|
|
Create → Skill/WeaponSkillSet로 무기별 스킬 묶음 생성
|
|
플레이어에 SkillManager + Effect 컴포넌트들 부착
|
|
무기 변경 시 LoadWeaponSkills(skillSet) 호출
|
|
입력 시 SkillInput(slotIndex, inputState) 호출
|
|
*/
|
|
|
|
[CreateAssetMenu(menuName = "Skill/SkillData")]
|
|
public class SkillData : ScriptableObject
|
|
{
|
|
[Header("기본 정보")]
|
|
public string SkillName;
|
|
[TextArea] public string Description;
|
|
public Sprite Icon;
|
|
|
|
[Header("스킬 분류")]
|
|
public SkillType SkillType;
|
|
public ActivationType ActivationType;
|
|
public TargetType TargetType;
|
|
|
|
[Header("애니메이션")]
|
|
public string AnimTrigger;
|
|
|
|
[Header("이펙트")]
|
|
public GameObject EffectPrefab;
|
|
|
|
[Header("범위 지정 (AreaSelect용)")]
|
|
public GameObject AreaIndicatorPrefab;
|
|
|
|
[Header("레벨별 수치")]
|
|
public SkillLevelData[] Levels;
|
|
|
|
public SkillLevelData GetLevelData(int level)
|
|
{
|
|
int idx = Mathf.Clamp(level - 1, 0, Levels.Length - 1);
|
|
return Levels[idx];
|
|
}
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class SkillLevelData
|
|
{
|
|
public float Damage;
|
|
public float Range;
|
|
public float Cooldown;
|
|
public float ManaCost;
|
|
public float Duration;
|
|
public float ChargeTimeMax;
|
|
}
|
|
|
|
public enum SkillType { Active, Passive }
|
|
public enum ActivationType { Instant, Charge, AreaSelect }
|
|
public enum TargetType { Self, Single, Area, Projectile }
|