public static void EnemyAnimation(byte fromClient, Packet packet) { //if (!Server.clients[fromClient].player.isHost) return; byte toClient = packet.ReadByte(); if (Server.clients[fromClient].player.activeScene != Server.clients[toClient].player.activeScene) { return; } string animation = packet.ReadString(); int id = packet.ReadInt(); ServerSend.EnemyAnimation(toClient, animation, id); }
private void AnimationEventDelegate(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip, int frameNum) { if (clip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Loop && clip.name != _storedClip || clip.wrapMode == tk2dSpriteAnimationClip.WrapMode.LoopSection && clip.name != _storedClip || clip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Once) { _storedClip = clip.name; tk2dSpriteAnimationFrame frame = clip.GetFrame(frameNum); string clipName = frame.eventInfo; //ServerSend.EnemyAnimation(clipName); foreach (byte player in playerIds) { ServerSend.EnemyAnimation(player, clipName, enemyId); } } }