public void RecordSetHookOperation(GameObject go, GameObject owner, bool isLeft, bool isAhss) { ReplayGameObject obj = replayWorld.Find(go); if (obj != null) { byte flag = isLeft ? (byte)0b1 : (byte)0b0; if (isAhss) { flag |= (byte)0b10; } ReplayGameObject ownerRGO = replayWorld.Find(owner); if (owner == null) { RecordDestroyOperation(go); return; } var info = new ObjectOperationInformation( ReplayObjectOperation.SetHook, new object[] { ownerRGO.Id, flag }, FengGameManagerMKII.FGM.logic.RoundTime ); objectOperations.Add(info); } }
public void OnAnimation(GameObject go, AnimationType type, string animation, float time = 0f) { ReplayGameObject resObject = World.ActiveObjects.FirstOrDefault(x => x.SourceObject == go); if (resObject == null) { return; } AnimationRecorder.RecordAnimationCall(resObject, type, animation, time); }
public void RecordDestroyOperation(GameObject go) { ReplayGameObject obj = replayWorld.Find(go); if (obj != null) { var info = new ObjectOperationInformation( ReplayObjectOperation.DestroyObject, new object[] { obj.Id }, FengGameManagerMKII.FGM.logic.RoundTime ); objectOperations.Add(info); } }
public void RecordAnimationCall(ReplayGameObject go, AnimationType type, string animation, float time = 0f) { int animationId; if (!animationsDictionary.TryGetValue(animation, out animationId)) { animationId = nextAnimId; animationsDictionary.Add(animation, nextAnimId++); } playedAnimations.Add(new AnimationPlayInformation( animationId, type, go.Id, FengGameManagerMKII.FGM.logic.RoundTime, time)); }
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); }