|
|
@@ -4,53 +4,23 @@ using UnityEngine;
|
|
|
|
|
|
public class Spirits : MonoBehaviour
|
|
|
{
|
|
|
- public enum SpiritType //英灵种类
|
|
|
+ public enum SpiritType //英灵种类
|
|
|
{
|
|
|
- Float = 0, //漂浮
|
|
|
- Assassin = 1, //冲刺
|
|
|
- Cook = 2, //烤串
|
|
|
- Invisible = 3, //隐身
|
|
|
+ Float = 0, //漂浮
|
|
|
+ Assassin = 1, //冲刺
|
|
|
+ Cook = 2, //烤串
|
|
|
+ Invisible = 3, //隐身
|
|
|
}
|
|
|
|
|
|
+ public int types; //英灵数量
|
|
|
+
|
|
|
public GameObject floatEffect; //漂浮特效预制体
|
|
|
|
|
|
public SpiritType currentSpirit = SpiritType.Float;
|
|
|
|
|
|
- /*
|
|
|
- public void SummonSpirit(SpiritType st)
|
|
|
+ public void RandomSpirit()
|
|
|
{
|
|
|
- switch (st)
|
|
|
- {
|
|
|
- case SpiritType.Float:
|
|
|
- //特效用预制体做
|
|
|
-
|
|
|
- break;
|
|
|
- case SpiritType.Assassin:
|
|
|
- break;
|
|
|
- case SpiritType.Invisible:
|
|
|
- break;
|
|
|
- case SpiritType.Cook:
|
|
|
- break;
|
|
|
- }
|
|
|
+ int a = Random.Range(0, types);
|
|
|
+ currentSpirit = (SpiritType)a;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- private void Update()
|
|
|
- {
|
|
|
- if (Input.GetKeyDown(KeyCode.P))
|
|
|
- {
|
|
|
- currentSpirit = SpiritType.Float;
|
|
|
- SummonSpirit(currentSpirit);
|
|
|
- }
|
|
|
- if (Input.GetKeyDown(KeyCode.O))
|
|
|
- {
|
|
|
- currentSpirit = SpiritType.Invisible;
|
|
|
- SummonSpirit(currentSpirit);
|
|
|
- }
|
|
|
- if (Input.GetKeyDown(KeyCode.I))
|
|
|
- {
|
|
|
- currentSpirit = SpiritType.Invisible;
|
|
|
- SummonSpirit(currentSpirit);
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|