Esempio n. 1
0
        public void SerializeWaveAttribute(int uniqueId, int waveId)
        {
            var waveData = new WaveAttributeData();

            waveData.LinkedUniqueId = uniqueId;
            waveData.WaveId         = waveId;
            waveAttributes_.Add(waveData);
            OnDataDirty.Invoke();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 public void ReloadFromSerialized(string serialized)
 {
     JsonUtility.FromJsonOverwrite(serialized, this);
     OnDataDirty.Invoke();
 }