53 lines
1.6 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|