69 lines
1.5 KiB
C#
69 lines
1.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.U2D.Animation;
|
|
using UnityEngine;
|
|
using UnityEngine.PlayerLoop;
|
|
|
|
|
|
[System.Serializable]
|
|
public class MobStat
|
|
{
|
|
|
|
[SerializeField] private float baseValue;
|
|
|
|
private float _value;
|
|
private bool _isChange = true;
|
|
|
|
private List<float> modifiers = new List<float>();
|
|
|
|
public MobStat(float baseValue)
|
|
{
|
|
this.baseValue = baseValue;
|
|
}
|
|
private float CalculStat()
|
|
{
|
|
float finalValue = baseValue;
|
|
foreach(float m in modifiers)
|
|
{
|
|
_value += m;
|
|
}
|
|
return finalValue;
|
|
}
|
|
public float fvalue
|
|
{
|
|
get { return fvalue; }
|
|
}
|
|
public int ivalue
|
|
{
|
|
get { return ivalue; }
|
|
}
|
|
}
|
|
public class MobBase : MonoBehaviour
|
|
{
|
|
[Header("Character Data")]
|
|
[SerializeField] private EnemyStat enemyStat;
|
|
public MobStat playerMaxSpeed;
|
|
public MobStat playerJumpPower;
|
|
public MobStat playerMaxJumpCount;
|
|
public MobStat playerHp;
|
|
void Awake()
|
|
{
|
|
if (enemyStat == null)
|
|
{
|
|
Debug.LogError("Character Data°¡ ÇÒ´çµÇÁö ¾Ê¾Ò½À´Ï´Ù!");
|
|
}
|
|
else
|
|
{
|
|
InitializeStat();
|
|
}
|
|
}
|
|
public void InitializeStat()
|
|
{
|
|
playerMaxSpeed = new MobStat(enemyStat.playerMaxSpeed);
|
|
playerJumpPower = new MobStat(enemyStat.playerJumpPower);
|
|
playerMaxJumpCount = new MobStat(enemyStat.playerMaxJumpCount);
|
|
playerHp = new MobStat(enemyStat.playerHp);
|
|
}
|
|
}
|