12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using UnityGameFramework.Runtime;
- /// <summary>
- /// 场景组件 月亮井
- /// </summary>
- public class SceneEventMoonWellLogic : MonoBehaviour
- {
- private float speed = 0;
- private float fullTime = 5;
- private float nowTimeCount = 0;
- private bool isFull = false;
- private void Awake()
- {
- }
- // Start is called before the first frame update
- void Start()
- {
- }
- public void Update()
- {
- if (!isFull)
- {
- nowTimeCount += Time.deltaTime;
- if (nowTimeCount > fullTime)
- {
- Animator anim = this.GetComponent<Animator>();
- anim.Play("full");
- isFull = true;
- nowTimeCount = 0;
- }
- }
- }
- public void OnTriggerStay(Collider collider)
- {
- Role role = collider.GetComponent<Role>();
- if (!role || role.isDie)
- {
- return;
- }
- if (isFull)
- {
- X2Battle.X2BattleManager.Instance.mBulletModel.OnCastSkill(
- 0, "602101",
- false, X2Battle.EBulletCastPoint.ECAST_POINT_DEFLUAT, role.mData.UID, false);
- isFull = false;
- Animator anim = this.GetComponent<Animator>();
- anim.Play("empty");
- }
- }
- public void OnTriggerEnter(Collider collider)
- {
- Role role = collider.GetComponent<Role>();
- if (role && isFull)
- {
- X2Battle.X2BattleManager.Instance.mBulletModel.OnCastSkill(
- 0, "602101",
- false, X2Battle.EBulletCastPoint.ECAST_POINT_DEFLUAT, role.mData.UID, false);
- isFull = false;
- Animator anim = this.GetComponent<Animator>();
- anim.Play("empty");
- }
- }
- public void OnTriggerExit(Collider collider)
- {
- }
- public void EnableCollider()
- {
- }
- public void OnClickInteractive()
- {
- }
- }
|