private void ProcessTurn(byte[] data, EndPoint sender) { uint attackerId = BitConverter.ToUInt32(data, 1); GameObject attackerObject = spawnedGameObjects[attackerId]; BaseClass attacker = attackerObject.GetComponent <BaseClass>(); int skillId = BitConverter.ToInt32(data, 5); BaseAttack skill = attacker.GetSkillFromID(skillId); uint targetId = BitConverter.ToUInt32(data, 9); BaseClass target = null; if (targetId != 172)//172 = targetNull { GameObject targetObject = spawnedGameObjects[targetId]; target = targetObject.GetComponent <BaseClass>(); } bsm.TurnReady(attacker, skill, target); }