public static void NotifyGfxHitTarget(GameObject src, int impactId, GameObject target, int hitCount, int skillId, int duration, UnityEngine.Vector3 srcPos, float srcDir, long hit_count_id) { SharedGameObjectInfo srcInfo = GfxSystem.Instance.GetSharedGameObjectInfo(src); SharedGameObjectInfo targetInfo = GfxSystem.Instance.GetSharedGameObjectInfo(target); if (null != srcInfo && null != targetInfo) { if (targetInfo.HandleEventCheckHitCanRelease != null && !targetInfo.HandleEventCheckHitCanRelease(src, impactId)) { return; } if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxHitTarget, srcInfo.m_LogicObjectId, impactId, targetInfo.m_LogicObjectId, hitCount, skillId, duration, srcPos.x, srcPos.y, srcPos.z, srcDir, hit_count_id); } } else { LogFromGfx("NotifyGfxHitTarget:{0} {1} {2} {3}, can't find object !", src.name, impactId, target.name, hitCount); } }
public void Execute(int actor_id) { if (!WorldSystem.Instance.IsPureClientScene()) { return; } SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(actor_id); if (share_info == null) { return; } Vector3 actor_pos = new Vector3(share_info.X, share_info.Y, share_info.Z); Vector3 assit_pos = CaclEndPos(actor_pos); UnityEngine.Vector3 end_pos = new UnityEngine.Vector3(assit_pos.X, assit_pos.Y, assit_pos.Z); bool ret = IsFadeIn(end_pos); if (ret) { TriggerLogic(share_info.LinkId); } else { m_CurNpcActorId = share_info.m_ActorId; LogicSystem.SendStoryMessage("playermovetopos", end_pos.x, end_pos.y, end_pos.z); } }
public static void NotifyGfxMoveControlFinish(GameObject obj, int id, bool isSkill) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (isSkill) { info.IsSkillGfxMoveControl = false; info.IsSkillGfxRotateControl = false; } else { info.IsImpactGfxMoveControl = false; info.IsImpactGfxRotateControl = false; } if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxControlMoveStop, info.m_LogicObjectId, id, isSkill); } //GfxLog("NotifyGfxMoveControlFinish:{0}", info.m_LogicObjectId); } else { LogFromGfx("NotifyGfxMoveControlFinish:{0}, can't find object !", obj.name); } }
public static void NotifyGfxSkillBreakSection(GameObject obj, int skillid, int breaktype, int starttime, int endtime, bool isinterrupt, string skillmessage) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSkillBreakSection, info.m_LogicObjectId, skillid, breaktype, starttime, endtime, isinterrupt, skillmessage); } } }
public static void NotifyGfxStartAttack(GameObject obj, float x, float y, float z) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxStartAttack, info.m_LogicObjectId, x, y, z); } } }
public static void NotifyGfxSetCrossFadeTime(GameObject obj, string fadeTargetAnim, float fadeTime) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSetCrossFadeTime, info.m_LogicObjectId, fadeTargetAnim, fadeTime); } } }
public static void NotifyGfxAddLockInputTime(GameObject obj, SkillCategory category, float lockinputtime) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxAddLockInputTime, info.m_LogicObjectId, category, lockinputtime); } } }
public static void NotifyGfxSetObjLifeTime(GameObject obj, long life_remain_time) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSetObjLifeTime, info.m_LogicObjectId, life_remain_time); } } }
public static void NotifyGfxSimulateMove(GameObject obj) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSimulateMove, info.m_LogicObjectId); } } }
public static void NotifyGfxChangeSkillControlMode(GameObject obj, SkillControlMode mode) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxChangeSkillControlMode, info.m_LogicObjectId, mode); } } }
public static void NotifyGfxSonsReleaseSkill(GameObject obj, int signskill, int skillid) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSonsReleaseSkill, info.m_LogicObjectId, signskill, skillid); } } }
public static void NotifyGfxRemoveSkillBreakSection(GameObject obj, int skillid, int breaktype) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxRemoveSkillBreakSection, info.m_LogicObjectId, skillid, breaktype); } } }
private Vector3 CaclEndPos(Vector3 tpos) { SharedGameObjectInfo user = LogicSystem.PlayerSelfInfo; if (null != user) { Vector3 spos = new Vector3(user.X, user.Y, user.Z); double dir = Math.Atan2(tpos.X - spos.X, tpos.Z - spos.Z); float dis = Vector3.Distance(spos, tpos) - 2.0f; Vector3 new_pos = new Vector3((float)Math.Sin(dir) * dis, 0f, (float)Math.Cos(dir) * dis); return(spos + new_pos); } return(Vector3.Zero); }
public static void NotifyGfxSummonNpc(GameObject obj, int owner_skillid, int npc_type_id, string model, int skillid, int ailogicid, bool followsummonerdead, float pos_x, float pos_y, float pos_z, string aiparamstr, int signforskill, bool isSimulate) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxSummonNpc, info.m_LogicObjectId, owner_skillid, npc_type_id, model, skillid, ailogicid, followsummonerdead, pos_x, pos_y, pos_z, aiparamstr, signforskill, isSimulate); } } }
public static void NotifyGfxStopImpact(GameObject src, int impactId, GameObject target) { if (null != src && null != target) { SharedGameObjectInfo srcInfo = GfxSystem.Instance.GetSharedGameObjectInfo(src); SharedGameObjectInfo targetInfo = GfxSystem.Instance.GetSharedGameObjectInfo(target); if (null != srcInfo && null != targetInfo) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxStopImpact, targetInfo.m_LogicObjectId, impactId); } } } }
public static void NotifyGfxChangedWantDir(GameObject obj, float ry) { lock (GfxSystem.SyncLock) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { info.WantFaceDir = ry; info.WantDirChangedByGfx = true; } else { LogFromGfx("NotifyGfxUpdatePosition:{0} {1}, can't find object !", obj.name, ry); } } }
public static void NotifyGfxUpdatePosition(GameObject obj, float x, float y, float z) { lock (GfxSystem.SyncLock) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { info.X = x; info.Y = y; info.Z = z; info.DataChangedByGfx = true; } else { LogFromGfx("NotifyGfxUpdatePosition:{0} {1} {2} {3}, can't find object !", obj.name, x, y, z); } } }
public static void NotifyGfxBreakSkill(GameObject obj, SkillCategory category) { if (null != obj) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxBreakSkill, info.m_LogicObjectId, category); } } else { LogFromGfx("NotifyGfxBreakSkill:{0} {1}, can't find object !", obj.name); } } }
public void Tick() { if (m_CurNpcActorId > 0) { SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(m_CurNpcActorId); if (share_info != null) { ArkCrossEngine.Vector3 actor_pos = new ArkCrossEngine.Vector3(share_info.X, share_info.Y, share_info.Z); ArkCrossEngine.Vector3 assit_pos = CaclEndPos(actor_pos); UnityEngine.Vector3 end_pos = new UnityEngine.Vector3(assit_pos.X, assit_pos.Y, assit_pos.Z); bool ret = IsFadeIn(end_pos); if (ret) { m_CurNpcActorId = 0; TriggerLogic(share_info.LinkId); } } } }
public static void NotifyGfxForceStartSkill(GameObject obj, int skillId) { if (null != obj) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxForceStartSkill, info.m_LogicObjectId, skillId); //GfxLog("NotifyGfxStartSkill:{0} {1}", obj.name, category); } } else { LogFromGfx("NotifyGfxForceStartSkill:{0} {1}, can't find object !", obj.name, skillId); } } }
public static void NotifyGfxAnimationStart(GameObject obj, bool isSkill) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (isSkill) { info.IsSkillGfxAnimation = true; } else { info.IsImpactGfxAnimation = true; } //GfxLog("NotifyGfxAnimationStart:{0}", info.m_LogicObjectId); } else { LogFromGfx("NotifyGfxAnimationStart:{0}, can't find object !", obj.name); } }
public static void NotifyGfxUpdatePositionAndDir(GameObject obj, float x, float y, float z, float rx, float ry, float rz) { lock (GfxSystem.SyncLock) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { info.X = x; info.Y = y; info.Z = z; info.FaceDir = ry; info.DataChangedByGfx = true; info.WantFaceDir = ry; info.WantDirChangedByGfx = true; } else { LogFromGfx("NotifyGfxUpdatePositionAndDir:{0} {1} {2} {3} {4} {5} {6}, can't find object !", obj.name, x, y, z, rx, ry, rz); } } }
public static void NotifyGfxStartSkill(GameObject obj, SkillCategory category, UnityEngine.Vector3 targetpos) { if (null != obj) { SharedGameObjectInfo info = GfxSystem.Instance.GetSharedGameObjectInfo(obj); if (null != info) { if (null != GfxSystem.Instance.GameLogicNotification) { QueueLogicAction(GfxSystem.Instance.GameLogicNotification.OnGfxStartSkill, info.m_LogicObjectId, category, targetpos.x, targetpos.y, targetpos.z); //GfxLog("NotifyGfxStartSkill:{0} {1}", obj.name, category); } } else { LogFromGfx("NotifyGfxStartSkill:{0} {1}, can't find object !", obj.name, category); } } }
public static void CreateGameObject(int id, string resource, SharedGameObjectInfo info) { QueueGfxAction(s_Instance.CreateGameObjectImpl, id, resource, info); }