Files
Main/Assets/Code/Logic/_Required/Entity/Character/Buff/ChuanDaoBuff.cs
2025-01-25 04:38:09 +08:00

53 lines
1.6 KiB
C#

using UnityEngine;
using UnityEditor;
using Thousandto.Code.Center;
using Thousandto.Code.Global;
namespace Thousandto.Code.Logic
{
//传道buff
public class ChuanDaoBuff : Buff
{
protected override void OnAddBuffSpecial(Character owner)
{
base.OnAddBuffSpecial(owner);
if(owner == null)
{
owner = GameCenter.GameSceneSystem.FindEntity<Character>(base.OwenId);
}
if(owner != null)
{
if (owner is Player)
{
var player = owner as Player;
player.IsChuanDaoing = true;
}
if (owner.IsLocalPlayer())
{
//进入传道时打开菜单
GameCenter.PushFixEvent(LogicEventDefine.EID_EVENT_ON_MAINMENU_OPEN);
GameCenter.PushFixEvent(Global.LogicEventDefine.EID_EVENT_CHUANDAO_SITDOWN_START);
}
}
}
protected override void OnDeleteBuffSpecial(Character owner)
{
base.OnDeleteBuffSpecial(owner);
if (owner == null)
{
owner = GameCenter.GameSceneSystem.FindEntity<Character>(base.OwenId);
}
if(owner != null)
{
if (owner is Player)
{
var player = owner as Player;
player.IsChuanDaoing = false;
}
}
}
}
}