using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityGameFramework.Runtime;
using X2Battle;
///
/// 场景组件 减速带 渗水池 进入增加buff 离开移除buff
///
public class SceneEventSeepbumpLogic : MonoBehaviour
{
private float speed = 0;
private void Awake()
{
}
// Start is called before the first frame update
void Start()
{
SceneCmptManager.Instance.AddMechanism(this.gameObject);
}
public void OnTriggerEnter(Collider collider)
{
Role role = collider.GetComponent();
if (!role || role.isDie)
{
return;
}
X2Battle.X2BattleManager.Instance.mBulletModel.OnCastSkill(
0, "711002",
false, EBulletCastPoint.ECAST_POINT_DEFLUAT, role.mData.UID, false);
SceneCmptManager.Instance.OpenMechanism(this.gameObject);
//speed = role.GetPropertyFinal(YLBattle.EBattleProperty.MOVESPEED);
//role.SetPropertyFinal(null,YLBattle.EBattleProperty.MOVESPEED, 0.3f);
//// buff挂载
//YLBattle.FieldEvent field = new YLBattle.FieldEvent();
//field.PutValue("tid", "801003");
//field.PutValue("skill", "0");
//field.PutValue("level", "1");
//field.PutValue("caster", "0");
//field.PutValue("target", role.ID());
//field.PutValue("skilltype", "7");
//field.PutValue("tipdelay", 0.ToString());
//X2BattleManager.Instance.mBuffModel.OnBuff(field);
}
public void OnTriggerExit(Collider collider)
{
Animator anim = this.GetComponent();
//anim.Play("full");
Role role = collider.GetComponent();
role.SetPropertyFinal(null, YLBattle.EBattleProperty.MOVESPEED, speed);
}
public void EnableCollider()
{
}
public void OnClickInteractive()
{
}
}