public void RemoveObject(DynamicArenaObjectData obj) { bool removed = objects_.Remove(obj); if (!removed) { Debug.LogWarning("Could not remove obj: " + obj + " because not in objects_!"); return; } OnDataDirty.Invoke(); }
public int SerializeObject(GameObject prefab, Vector3 position, Quaternion rotation, Vector3 localScale) { var objectData = new DynamicArenaObjectData(); objectData.PrefabName = prefab.name; objectData.Position = position; objectData.Rotation = rotation; objectData.LocalScale = localScale; objectData.UniqueId = objects_.Count + 1; objects_.Add(objectData); OnDataDirty.Invoke(); return(objectData.UniqueId); }