public void SerializeWaveAttribute(int uniqueId, int waveId) { var waveData = new WaveAttributeData(); waveData.LinkedUniqueId = uniqueId; waveData.WaveId = waveId; waveAttributes_.Add(waveData); OnDataDirty.Invoke(); }
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 void SerializePlayerSpawnPoint(int index, Vector3 position) { if (index < 0 || index >= 4) { Debug.LogError("Invalid index: " + index + " when trying to serialize player spawn point!"); return; } PlayerSpawnPoints[index] = position; OnDataDirty.Invoke(); }
public int SerializeWall(GameObject prefab, Vector3 position, IEnumerable <Vector3> vertexLocalPositions) { var wallData = new DynamicArenaWallData(); wallData.PrefabName = prefab.name; wallData.Position = position; wallData.VertexLocalPositions = vertexLocalPositions.ToArray(); wallData.UniqueId = kWallIndexOffset + walls_.Count + 1; walls_.Add(wallData); OnDataDirty.Invoke(); return(wallData.UniqueId); }
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); }
public void ReloadFromSerialized(string serialized) { JsonUtility.FromJsonOverwrite(serialized, this); OnDataDirty.Invoke(); }