/// <summary> /// Ends the restting process of the active robot and resets the replay tracking objects /// </summary> public void EndRobotReset() { ActiveRobot.EndReset(); foreach (Tracker t in UnityEngine.Object.FindObjectsOfType <Tracker>()) { t.Clear(); CollisionTracker.Reset(); } }
/// <summary> /// Робот начнёт прохождение маршрута /// </summary> /// <param name="platform">Платформа с которой начнёт робот</param> public void StartRobotMove(Platform platform) { RemoveRobotFromPlatform(); ActiveRobot.SetVisibility(true); ActiveRobot.transform.Translate(platform.transform.position); StartMoveAction(this, new GenericEventArgs <Robot>(_activeRobot)); StartCoroutine(ActiveRobot.StartMove()); GameManager.instance.Batterys--; }
/// <summary> /// Changes the active robot to a new robot with a given directory /// </summary> /// <param name="directory"></param> /// <returns>whether the process was successful</returns> public bool ChangeRobot(string directory, bool isMixAndMatch) { sensorManager.RemoveSensorsFromRobot(ActiveRobot); sensorManagerGUI.ShiftOutputPanels(); sensorManagerGUI.EndProcesses(); if (ActiveRobot.RobotHasManipulator) { ActiveRobot.DeleteManipulatorNodes(); ActiveRobot.RobotHasManipulator = false; } ActiveRobot.RobotIsMixAndMatch = isMixAndMatch; return(ActiveRobot.InitializeRobot(directory, this)); }
public override void Update(GameTime gameTime) { TeleportAnimation.Update(gameTime); PolygonCollisionResult FinalCollisionResult = new PolygonCollisionResult(Vector2.Zero, -1); foreach (RobotAnimation ActiveRobot in Owner.DicRobot.Values) { foreach (CollisionPolygon EnemyCollision in ActiveRobot.ListCollisionPolygon) { PolygonCollisionResult CollisionResult = Polygon.PolygonCollisionSAT(TeleportPolygon, EnemyCollision.ActivePolygon, ActiveRobot.Speed); if (CollisionResult.Distance >= 0 && CollisionResult.Distance > FinalCollisionResult.Distance) { ActiveRobot.Speed += _TeleportSpeed; ActiveRobot.Move(_TeleportOffset); Owner.ChangeRobotLayer(ActiveRobot, _LayerIndex); } } } }
/// <summary> /// Resets the active robot orientation to how the CAD model was originally defined (should be standing upright and facing forward if CAD was done properly) /// </summary> public void ResetRobotOrientation() { ActiveRobot.ResetRobotOrientation(); }
/// <summary> /// Rotates the active robot about its origin by a set vector /// </summary> public void RotateRobot(Vector3 rotation) { ActiveRobot.RotateRobot(rotation); }
/// <summary> /// Rotates the active robot about its origin by a mathematical 4x4 matrix /// </summary> public void RotateRobot(BulletSharp.Math.Matrix rotationMatrix) { ActiveRobot.RotateRobot(rotationMatrix); }
/// <summary> /// Shifts the active robot by a set transposition vector /// </summary> public void TranslateRobot(Vector3 transposition) { ActiveRobot.TranslateRobot(transposition); }
/// <summary> /// Starts the resetting process of the active robot /// </summary> public void BeginRobotReset() { ActiveRobot.BeginReset(); }
public void Update(GameTime gameTime) { lock (ListDelayedOnlineCommand) { foreach (DelayedExecutableOnlineScript ActiveCommand in ListDelayedOnlineCommand) { ActiveCommand.ExecuteOnMainThread(); } ListDelayedOnlineCommand.Clear(); } for (int A = ListVisualEffects.Count - 1; A >= 0; --A) { SimpleAnimation ActiveVisualEffect = ListVisualEffects[A]; ActiveVisualEffect.Update(gameTime); if (ActiveVisualEffect.HasEnded) { ListVisualEffects.RemoveAt(A); } } for (int A = 0; A < ListAttackCollisionBox.Count; A++) { AttackBox ActiveAttackBox = (AttackBox)ListAttackCollisionBox[A]; if (!ActiveAttackBox.IsAlive) { continue; } ActiveAttackBox.Update(gameTime); foreach (KeyValuePair <uint, RobotAnimation> ActiveRobot in DicRobot) { UpdateAttackCollisionWithRobot(gameTime, ActiveAttackBox, ActiveRobot.Value); } UpdateAttackCollisionWithWorld(ActiveAttackBox); ActiveAttackBox.Move(gameTime); } for (int A = ListImages.Count - 1; A >= 0; --A) { SimpleAnimation ActiveAnimation = ListImages[A]; ActiveAnimation.Update(gameTime); if (ActiveAnimation.HasEnded) { ListImages.RemoveAt(A); } } for (int P = ListProp.Count - 1; P >= 0; --P) { if (ListProp[P].HasEnded) { ListProp.RemoveAt(P); } else { ListProp[P].Update(gameTime); } } #region Robot Update foreach (RobotAnimation ActiveRobot in DicRobot.Values) { if (!ActiveRobot.IsUpdated) { continue; } if (ActiveRobot.RobotAI != null && !Owner.UsePreview) { ActiveRobot.RobotAI.UpdateStep(gameTime); } ActiveRobot.Update(gameTime, DicRobot); } foreach (RobotAnimation RobotToAdd in ListRobotToAdd) { SpawnRobot(RobotToAdd); } ListRobotToAdd.Clear(); for (int R = ListRobotToRemove.Count - 1; R >= 0; R--) { DicRobot.Remove(ListRobotToRemove[R]); ListRobotToRemove.RemoveAt(R); if (ListRobotToRemove.Count == 0) { Owner.CheckIfAllEnemiesAreDead(); } } #endregion }
/// <summary> /// Loads a manipulator for Mix and Match mode and maps it to the robot. /// </summary> /// <param name="directory"></param> /// <returns></returns> public bool LoadManipulator(string directory, GameObject robotGameObject) { ActiveRobot.RobotHasManipulator = true; return(ActiveRobot.InitializeManipulator(directory, robotGameObject)); }
/// <summary> /// Loads a manipulator for Mix and Match mode and maps it to the robot. /// </summary> /// <param name="directory"></param> /// <returns></returns> public bool LoadManipulator(string directory) { ActiveRobot.RobotHasManipulator = true; return(ActiveRobot.InitializeManipulator(directory, null)); }
/// <summary> /// Changes the control index of the active robot /// </summary> public void ChangeControlIndex(int index) { ActiveRobot.SetControlIndex(index); }
/// <summary> /// Used to delete manipulator nodes in MaM mode /// </summary> public void DeleteManipulatorNodes() { ActiveRobot.DeleteManipulatorNodes(); }
/// <summary> /// Saves the active robot's current orientation to be used whenever robot is reset /// </summary> public void SaveRobotOrientation() { ActiveRobot.SaveRobotOrientation(); }
/// <summary> /// Cancels the active robot's unsaved orientation changes /// </summary> public void CancelRobotOrientation() { ActiveRobot.CancelRobotOrientation(); }
public void RevertSpawnpoint() { ActiveRobot.BeginRevertSpawnpoint(); }