コード例 #1
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <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();
     }
 }
コード例 #2
0
        /// <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--;
        }
コード例 #3
0
    /// <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));
    }
コード例 #4
0
ファイル: Prop.cs プロジェクト: VenturingGuy/Project-Eternity
        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);
                    }
                }
            }
        }
コード例 #5
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <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();
 }
コード例 #6
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Rotates the active robot about its origin by a set vector
 /// </summary>
 public void RotateRobot(Vector3 rotation)
 {
     ActiveRobot.RotateRobot(rotation);
 }
コード例 #7
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Rotates the active robot about its origin by a mathematical 4x4 matrix
 /// </summary>
 public void RotateRobot(BulletSharp.Math.Matrix rotationMatrix)
 {
     ActiveRobot.RotateRobot(rotationMatrix);
 }
コード例 #8
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Shifts the active robot by a set transposition vector
 /// </summary>
 public void TranslateRobot(Vector3 transposition)
 {
     ActiveRobot.TranslateRobot(transposition);
 }
コード例 #9
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Starts the resetting process of the active robot
 /// </summary>
 public void BeginRobotReset()
 {
     ActiveRobot.BeginReset();
 }
コード例 #10
0
        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
        }
コード例 #11
0
 /// <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));
 }
コード例 #12
0
 /// <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));
 }
コード例 #13
0
 /// <summary>
 /// Changes the control index of the active robot
 /// </summary>
 public void ChangeControlIndex(int index)
 {
     ActiveRobot.SetControlIndex(index);
 }
コード例 #14
0
 /// <summary>
 /// Used to delete manipulator nodes in MaM mode
 /// </summary>
 public void DeleteManipulatorNodes()
 {
     ActiveRobot.DeleteManipulatorNodes();
 }
コード例 #15
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Saves the active robot's current orientation to be used whenever robot is reset
 /// </summary>
 public void SaveRobotOrientation()
 {
     ActiveRobot.SaveRobotOrientation();
 }
コード例 #16
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 /// <summary>
 /// Cancels the active robot's unsaved orientation changes
 /// </summary>
 public void CancelRobotOrientation()
 {
     ActiveRobot.CancelRobotOrientation();
 }
コード例 #17
0
ファイル: MainState.cs プロジェクト: ezhangle/synthesis
 public void RevertSpawnpoint()
 {
     ActiveRobot.BeginRevertSpawnpoint();
 }