public void RecordSpawnOperation(ReplayObjectOperation opType, GameObject go, Vector3 position, Quaternion rotation) { string resourceName = go.name.Replace("(Clone)", string.Empty).Trim(); if (replayWorld.Resources.Contains(resourceName) == false) { replayWorld.Resources.AddPrefab(new KeyValuePair <string, int>(resourceName, NextResourcesId)); } ReplayGameObject res = replayWorld.SpawnObject(go); if (opType != ReplayObjectOperation.SpawnEffect) { res.IsObservableObject = true; } var info = new ObjectOperationInformation( opType, new object[] { position, rotation }, FengGameManagerMKII.FGM.logic.RoundTime ); objectOperations.Add(info); }
public ObjectOperationInformation(ReplayObjectOperation opType, object[] args, float time) { OperationType = opType; Arguments = args; TimeStamp = time; }