public void RunTick(PlayerTickData tickData = null)
 {
     if (tickData != null)
     {
         if (tickData.dataType == (int)TickDataType.SpawnPlayer)
         {
             SpawnPlayerTickData spawnData = tickData.data as SpawnPlayerTickData;
             CharacterInfo       charInfo  = new CharacterInfo((ClassType)spawnData.playerClass, (Weapon)spawnData.weapon, Boots.Armor);
             spawnPlayer(charInfo);
         }
         else if (tickData.dataType == (int)TickDataType.SpawnEnemy)
         {
             if (TickManager.Instance.Tick % 50 == 0)
             {
                 SpawnEnemyTickData spawnData = tickData.data as SpawnEnemyTickData;
                 Vector3            position  = new Vector3(spawnData.xPos, spawnData.yPos, spawnData.zPos);
             }
         }
         else if (tickData.dataType == (int)TickDataType.HealthPack)
         {
             HealthPackData hpData = tickData.data as HealthPackData;
             dropItem(new Vector3(hpData.xPos, hpData.yPos, 0));
         }
     }
 }
    public void SendTick()
    {
        if (player == null)
        {
            PlayerTickData data = new PlayerTickData();
            data.dataType = (int)TickDataType.SpawnPlayer;
            SpawnPlayerTickData spawnData = new SpawnPlayerTickData();
            spawnData.peerId      = 0;
            spawnData.playerClass = (int)charInfo.charClass;
            spawnData.weapon      = (int)Weapon.Blaster;
            data.data             = spawnData;

            byte[] byteData = ObjectToByteArray <PlayerTickData>(data);
            tickList.Add(byteData);
            TickManager.Instance.ReceiveTick(byteData);
        }
        else
        {
            PlayerTickData data = new PlayerTickData();
            data.dataType = (int)TickDataType.SpawnEnemy;
            SpawnEnemyTickData spawnData = new SpawnEnemyTickData();
            Vector3            randomPos = player.transform.position + new Vector3(9, -2 + Random.value * 4);
            spawnData.xPos = randomPos.x;
            spawnData.yPos = randomPos.y;
            spawnData.zPos = randomPos.z;
            data.data      = spawnData;

            byte[] byteData = ObjectToByteArray <PlayerTickData>(data);
            tickList.Add(byteData);
            TickManager.Instance.ReceiveTick(byteData);
        }
    }