|
@@ -22,7 +22,6 @@ public enum CharacterState
|
|
|
Die = 11,
|
|
Die = 11,
|
|
|
Weak = 12,
|
|
Weak = 12,
|
|
|
|
|
|
|
|
- Spirits = 14, //召唤英灵
|
|
|
|
|
Float = 15, //空中漂浮
|
|
Float = 15, //空中漂浮
|
|
|
|
|
|
|
|
Coma = 21, //昏迷
|
|
Coma = 21, //昏迷
|
|
@@ -32,14 +31,6 @@ public enum CharacterState
|
|
|
SpecialStatus,
|
|
SpecialStatus,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//血量上限增加类型
|
|
|
|
|
-public enum HpUpType
|
|
|
|
|
-{
|
|
|
|
|
- Degree = 0, //按一定比例加血
|
|
|
|
|
- Add = 1, //直接加血
|
|
|
|
|
- Fixed = 2, //加固定血量
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
public class Character : MonoBehaviour
|
|
public class Character : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
[Header("骨骼")]
|
|
[Header("骨骼")]
|
|
@@ -76,10 +67,13 @@ public class Character : MonoBehaviour
|
|
|
public Character attackTarget;
|
|
public Character attackTarget;
|
|
|
|
|
|
|
|
[Header("角色状态")]
|
|
[Header("角色状态")]
|
|
|
|
|
+ [DisplayOnly]
|
|
|
public CharacterState state;
|
|
public CharacterState state;
|
|
|
public int totalHp = 100;
|
|
public int totalHp = 100;
|
|
|
public int hp;
|
|
public int hp;
|
|
|
|
|
+ [DisplayOnly]
|
|
|
public bool isDie = false; //已死亡
|
|
public bool isDie = false; //已死亡
|
|
|
|
|
+ [DisplayOnly]
|
|
|
public bool isRevive; //从虚弱状态恢复中
|
|
public bool isRevive; //从虚弱状态恢复中
|
|
|
public bool canNotAddForce; //不会被打飞
|
|
public bool canNotAddForce; //不会被打飞
|
|
|
public bool canNotChangeHurt; //不会被打虚弱
|
|
public bool canNotChangeHurt; //不会被打虚弱
|
|
@@ -96,10 +90,8 @@ public class Character : MonoBehaviour
|
|
|
public LockSoul ls;
|
|
public LockSoul ls;
|
|
|
public bool isInSoulTower; //在锁魂塔范围内
|
|
public bool isInSoulTower; //在锁魂塔范围内
|
|
|
|
|
|
|
|
- [Header("血量上限增加类型")]
|
|
|
|
|
- public HpUpType hptp;
|
|
|
|
|
-
|
|
|
|
|
[Header("体型增大")]
|
|
[Header("体型增大")]
|
|
|
|
|
+ [HideInInspector]
|
|
|
public bool beLarger = false;
|
|
public bool beLarger = false;
|
|
|
public float toLargeSize = 0; //变大程度
|
|
public float toLargeSize = 0; //变大程度
|
|
|
private Vector3 speed = new Vector3(1, 1, 0); //变大速度
|
|
private Vector3 speed = new Vector3(1, 1, 0); //变大速度
|
|
@@ -137,7 +129,10 @@ public class Character : MonoBehaviour
|
|
|
uiHp.Show(hp, totalHp);
|
|
uiHp.Show(hp, totalHp);
|
|
|
ChangeState(CharacterState.Idle);
|
|
ChangeState(CharacterState.Idle);
|
|
|
|
|
|
|
|
- attackController = GetComponent<AttackController>();
|
|
|
|
|
|
|
+ if (attackController == null)
|
|
|
|
|
+ {
|
|
|
|
|
+ attackController = GetComponent<AttackController>();
|
|
|
|
|
+ }
|
|
|
attackController.Init();
|
|
attackController.Init();
|
|
|
attackTarget = attackController.attackTarget;
|
|
attackTarget = attackController.attackTarget;
|
|
|
targetCharacter = attackController.targetCharacter;
|
|
targetCharacter = attackController.targetCharacter;
|
|
@@ -220,19 +215,8 @@ public class Character : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
cookEffect.transform.GetChild(0).gameObject.SetActive(true);
|
|
cookEffect.transform.GetChild(0).gameObject.SetActive(true);
|
|
|
int add = 0;
|
|
int add = 0;
|
|
|
- switch (hptp)
|
|
|
|
|
- {
|
|
|
|
|
- case HpUpType.Degree:
|
|
|
|
|
- value = value / 100;
|
|
|
|
|
- add = (int)(totalHp * value);
|
|
|
|
|
- break;
|
|
|
|
|
- case HpUpType.Add:
|
|
|
|
|
- add = (int)value;
|
|
|
|
|
- break;
|
|
|
|
|
- case HpUpType.Fixed:
|
|
|
|
|
- add = (int)(totalHp - value);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ value = value / 100;
|
|
|
|
|
+ add = (int)(totalHp * value);
|
|
|
totalHp += add;
|
|
totalHp += add;
|
|
|
hp += add;
|
|
hp += add;
|
|
|
uiHp.Show(hp, totalHp);
|
|
uiHp.Show(hp, totalHp);
|