public void Randomize() { materials = new GameMaterial[MaterialSize]; for (int i = 0; i < MaterialSize; i++) { materials[i] = new GameMaterial(); materials[i].id = "ID00" + i; materials[i].name = "LOREM IPSUM " + Random.Range(0, 1000); //materials[i].Costo = Random.Range(0, 1000); materials[i].color = Random.ColorHSV(); materials[i].sprite = SpritePool.RandomSprite(); } //ToUI(); }
//Static Method to create an ExampleXML public static WorkerDataList ExampleData() { WorkerDataList dl = new WorkerDataList(); WorkerData d1 = new WorkerData() { Id = "d1", Name = "Worker1", Price = 8000, Quantity = 1, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), Tired = 0, Talent = 50, Motivation = 0.4f, R = 1, G = 1, B = 1, A = 1 }; WorkerData d2 = new WorkerData() { Id = "d2", Name = "DevilWorker", Price = 666, Quantity = 6, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), Tired = 0.2f, Talent = 20, Motivation = 0.1f, R = 1, G = 0, B = 0, A = 1 }; dl.workers = new WorkerData[2]; dl.workers[0] = d1; dl.workers[1] = d2; return(dl); }
//Static method to get an XML Example of the data public static PieceDataList ExampleData() { PieceDataList pdl = new PieceDataList(); pdl.pieces = new PieceData[2]; pdl.pieces[0] = new PieceData() { Id = "P01", Name = "Piece 01", IsOnlyColor = true, Quantity = 0, SecondsNeeded = 40, Requirements = "d5 10, d3 1,", QuantityToCreate = 1, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), R = 1, G = 1, B = 1, A = 1 }; pdl.pieces[1] = new PieceData() { Id = "P02", Name = "Piece 02", IsOnlyColor = false, Quantity = 0, SecondsNeeded = 20, Requirements = "d4 1, d3 1,", QuantityToCreate = 5, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), R = 1, G = 1, B = 1, A = 1 }; return(pdl); }
//Static Method to create an ExampleXML public static MaterialDataList ExampleData() { MaterialDataList dl = new MaterialDataList(); MaterialData d1 = new MaterialData() { Id = "d1", Name = "Name1", Price = 900, Quantity = 4, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), R = 1, G = 0, B = 0, A = 1 }; MaterialData d2 = new MaterialData() { Id = "d2", Name = "Name2", Price = 666, Quantity = 6, SpriteId = SpritePool.GetId(SpritePool.RandomSprite()), R = 0, G = 0, B = 1, A = 1 }; dl.materials = new MaterialData[2]; dl.materials[0] = d1; dl.materials[1] = d2; return(dl); }