|
|
@@ -19,6 +19,8 @@ public class ESpirits_Float : MonoBehaviour
|
|
|
public float lastTime = 10f; //漂浮持续时间
|
|
|
public GameObject fe; //漂浮脚本
|
|
|
public GameObject lockEffect; //锁定特效
|
|
|
+ private GameObject curFe;
|
|
|
+ private GameObject curLock;
|
|
|
|
|
|
private GameObject player1;
|
|
|
private GameObject player2;
|
|
|
@@ -27,8 +29,9 @@ public class ESpirits_Float : MonoBehaviour
|
|
|
|
|
|
private void Awake()
|
|
|
{
|
|
|
- Instantiate(fe, transform.position, new Quaternion(0, 0, 0, 0), transform);
|
|
|
- Instantiate(lockEffect, new Vector3(0, -50, 0), new Quaternion(0, 0, 0, 0), transform);
|
|
|
+ curFe = Instantiate(fe, transform.position, new Quaternion(0, 0, 0, 0), transform);
|
|
|
+ curFe.GetComponent<FloatEffect>().isEnemy = true;
|
|
|
+ curLock = Instantiate(lockEffect, new Vector3(0, -50, 0), new Quaternion(0, 0, 0, 0), transform);
|
|
|
lockEffect.SetActive(false);
|
|
|
player1 = PlayersInput.instance[0].gameObject;
|
|
|
player2 = PlayersInput.instance[1].gameObject;
|
|
|
@@ -62,14 +65,14 @@ public class ESpirits_Float : MonoBehaviour
|
|
|
|
|
|
private void FollowPlayer()
|
|
|
{
|
|
|
- lockEffect.transform.position = target.transform.position;
|
|
|
+ curLock.transform.position = target.transform.position;
|
|
|
}
|
|
|
|
|
|
public void FloatAttack()
|
|
|
{
|
|
|
- fe.transform.position = lockEffect.transform.position;
|
|
|
- lockEffect.SetActive(false);
|
|
|
- fe.SetActive(true);
|
|
|
+ curFe.transform.position = lockEffect.transform.position;
|
|
|
+ curLock.SetActive(false);
|
|
|
+ curFe.SetActive(true);
|
|
|
}
|
|
|
|
|
|
private void Update()
|