Example #1
0
    private void GetShipInfo(string message)
    {
        Debug.Log("ShipInfo: " + message);
        try
        {
            shipInfo = new ShipInfo();
            string[] parts = message.Split(':');

            shipInfo.health       = int.Parse(parts[1]);
            shipInfo.damage       = int.Parse(parts[2]);
            shipInfo.shield       = int.Parse(parts[3]);
            shipInfo.speed        = int.Parse(parts[4]);
            shipInfo.shipSkin     = int.Parse(parts[5]);
            shipInfo.abilityType  = (AbilityType)int.Parse(parts[6]);
            shipInfo.abilityLevel = int.Parse(parts[7]);

            Debug.Log(shipInfo.ToString());
        }
        catch (Exception e)
        {
            Debug.Log("Ship generation failed");
            Debug.Log(e.Message);
        }
    }