2024-11-14 18:15:51 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class FeiJian : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public RectTransform rec;
|
|
|
|
|
public float moveSpeed;
|
|
|
|
|
|
|
|
|
|
private Vector3 startPos;
|
|
|
|
|
|
|
|
|
|
void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
startPos = rec.localPosition;
|
2024-11-21 18:05:42 +08:00
|
|
|
|
GameMgr.Instance.isFeijianClose = false;
|
2024-11-14 18:15:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
2024-11-21 18:05:42 +08:00
|
|
|
|
//<2F>ɽ<EFBFBD><C9BD>ڷ<EFBFBD><DAB7>й<EFBFBD><D0B9><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB>˵<EFBFBD>ͼ<EFBFBD><CDBC>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if (GameMgr.Instance.isFeijianClose)
|
|
|
|
|
{
|
|
|
|
|
this.transform.position = Vector3.zero;
|
|
|
|
|
PoolMgr.Instance.PushObj(this.gameObject);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-14 18:15:51 +08:00
|
|
|
|
startPos.x += Time.deltaTime* moveSpeed;
|
|
|
|
|
rec.localPosition= startPos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnTriggerEnter2D(Collider2D collider2D)
|
|
|
|
|
{
|
|
|
|
|
EventCenter.Instance.EventTrigger<PlayerData>(E_EventType.E_Monster_Wound,GameDataMgr.Instance.player);
|
|
|
|
|
this.transform.position=Vector3.zero;
|
2024-11-28 17:59:14 +08:00
|
|
|
|
rec.localScale = Vector3.one;
|
2024-11-14 18:15:51 +08:00
|
|
|
|
PoolMgr.Instance.PushObj(this.gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|