public static Ship2 fromDynamic(dynamic json) { Ship2 ship2 = new Ship2(); ship2.ships = new List <ShipValue>(); foreach (var data in json) { ship2.ships.Add(ShipValue.fromDynamic(data)); } return(ship2); }
void SpawnShip() { Vector3 spawnPosition = new Vector3(Random.Range(-475, 475), 0, 0); GameObject newShip = Instantiate(enemy, transform); newShip.transform.localPosition = spawnPosition; ShipValue valueScript = newShip.GetComponent <ShipValue>(); valueScript.RandomizeValue(); newShip.name = "" + valueScript.value; }
public static Getship fromDynamic(dynamic json) { Getship getship = new Getship(); getship.id = (int)json.api_id; getship.ship_id = (int)json.api_ship_id; getship.kdock = KDock.fromDynamic(json.api_kdock); getship.ship = ShipValue.fromDynamic(json.api_ship); getship.slotitem = new List <GetshipSlotitemValue>(); if (json.api_slotitem != null) { foreach (var data in json.api_slotitem) { getship.slotitem.Add(GetshipSlotitemValue.fromDynamic(data)); } } return(getship); }
public ConfigItem(IMyProgrammableBlock Me, IMyGridTerminalSystem gridTerminalSystem, string configTitle, Action <string> Echo) : base(Me, configTitle) { DisplayedProperty = (ShipDisplayValue)Enum.Parse(typeof(ShipDisplayValue), configTitle); ShipValue = new ShipValue(DisplayedProperty, gridTerminalSystem, Me, Echo); }
private void Start() { _shipValue = GameObject.Find("SpaceShip").GetComponent <ShipValue>(); }