void OnServantChange(object sender, Pathea.ServantLeaderCmpt.ServantChanged arg) { Pathea.Action_Fell actionFell = arg.servant.motionMgr.GetAction <Pathea.Action_Fell>(); if (null == actionFell) { return; } if (arg.isAdd) { actionFell.hpChange += SetSliderValue; } else { actionFell.hpChange -= SetSliderValue; } }
void AttachEvent() { Pathea.Action_Fell actionFell = Pathea.PeCreature.Instance.mainPlayer.motionMgr.GetAction <Pathea.Action_Fell>(); if (null != actionFell) { mAttached = true; actionFell.startFell += StartFell; actionFell.endFell += EndFell; actionFell.hpChange += SetSliderValue; } Pathea.ServantLeaderCmpt servantLeaderCmpt = Pathea.PeCreature.Instance.mainPlayer.GetCmpt <Pathea.ServantLeaderCmpt>(); if (null != servantLeaderCmpt) { servantLeaderCmpt.changeEventor.Subscribe(OnServantChange); } }