public void ObjectItem(S.ObjectItem p) { GameObject model = Instantiate(Resources.Load($"{p.Image}"), CurrentScene.Cells[p.Location.X, p.Location.Y].position, Quaternion.identity) as GameObject; ItemObject item = model.GetComponent <ItemObject>(); item.Name = p.Name; item.ObjectID = p.ObjectID; item.CurrentLocation = new Vector2(p.Location.X, p.Location.Y); CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(item); ObjectList.Add(p.ObjectID, item); }
public void Load(S.ObjectItem info) { Name = info.Name; NameColour = info.NameColour; BodyLibrary = Libraries.FloorItems; CurrentLocation = info.Location; MapLocation = info.Location; GameScene.Scene.MapControl.AddObject(this); DrawFrame = info.Image; Size = BodyLibrary.GetTrueSize(DrawFrame); DrawY = CurrentLocation.Y; }
public static void ObjectItem(S.ObjectItem p) { gameManager.ObjectItem(p); }