public void ObjectGold(S.ObjectGold p) { GameObject model; if (p.Gold < 100) { model = Instantiate(GoldModels[0], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity); } else if (p.Gold < 200) { model = Instantiate(GoldModels[1], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity); } else if (p.Gold < 500) { model = Instantiate(GoldModels[2], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity); } else if (p.Gold < 1000) { model = Instantiate(GoldModels[3], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity); } else { model = Instantiate(GoldModels[4], CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity); } ItemObject gold = model.GetComponent <ItemObject>(); gold.Name = string.Format("Gold ({0:###,###,###})", p.Gold); gold.ObjectID = p.ObjectID; gold.OutlineMaterial = OutlineMaterial; CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(gold); ObjectList.Add(p.ObjectID, gold); }
public void Load(S.ObjectGold info) { // Name = string.Format("Gold ({0:###,###,###})", info.Gold); Name = "金币"; BodyLibrary = Libraries.FloorItems; CurrentLocation = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); if (info.Gold < 100) { DrawFrame = 112; } else if (info.Gold < 200) { DrawFrame = 113; } else if (info.Gold < 500) { DrawFrame = 114; } else if (info.Gold < 1000) { DrawFrame = 115; } else { DrawFrame = 116; } Size = BodyLibrary.GetTrueSize(DrawFrame); DrawY = CurrentLocation.Y; }
public static void ObjectGold(S.ObjectGold p) { gameManager.ObjectGold(p); }