Exemplo n.º 1
0
 /// <inheritdoc/>
 void IAddElementsHandler.AddElement(Vector3 addPosition)
 {
     ScenarioManager.Instance.IsScenarioDirty = true;
     ScenarioManager.Instance.GetExtension <ScenarioUndoManager>()
     .RegisterRecord(new UndoAddElement(newWaypointInstance));
     newWaypointInstance = agentWaypointsPath.GetWaypointInstance();
     newWaypointInstance.ForceMove(addPosition);
     agentWaypointsPath.AddWaypoint(newWaypointInstance, null);
 }
        /// <inheritdoc/>
        void IAddElementsHandler.AddElement(Vector3 addPosition)
        {
            var path = destinationPointExtension.DestinationPoint.PlaybackPath;

            ScenarioManager.Instance.IsScenarioDirty = true;
            ScenarioManager.Instance.GetExtension <ScenarioUndoManager>()
            .RegisterRecord(new UndoAddElement(newWaypointInstance));
            newWaypointInstance = path.GetWaypointInstance();
            newWaypointInstance.ForceMove(addPosition);
            path.AddWaypoint(newWaypointInstance, null);
        }
        /// <inheritdoc/>
        void IAddElementsHandler.AddElement(Vector3 addPosition)
        {
            ScenarioManager.Instance.IsScenarioDirty = true;
            ScenarioManager.Instance.GetExtension <ScenarioUndoManager>()
            .RegisterRecord(new UndoAddElement(newWaypointInstance));
            var mapWaypointPrefab =
                ScenarioManager.Instance.GetExtension <ScenarioWaypointsManager>().waypointPrefab;

            newWaypointInstance = ScenarioManager.Instance.prefabsPools
                                  .GetInstance(mapWaypointPrefab).GetComponent <ScenarioWaypoint>();
            newWaypointInstance.ForceMove(addPosition);
            agentWaypoints.AddWaypoint(newWaypointInstance, true);
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        void IAddElementsHandler.AddingStarted(Vector3 addPosition)
        {
            newWaypointInstance = agentWaypointsPath.GetWaypointInstance();
            if (newWaypointInstance == null)
            {
                Debug.LogWarning(
                    $"Cannot add waypoints. Add {nameof(ScenarioAgentWaypoint)} component to the prefab.");
                ScenarioManager.Instance.GetExtension <InputManager>().CancelAddingElements(this);
                return;
            }

            newWaypointInstance.ForceMove(addPosition);
            agentWaypointsPath.AddWaypoint(newWaypointInstance, null);
            isAddingWaypoints = true;
        }
        /// <inheritdoc/>
        void IAddElementsHandler.AddingStarted(Vector3 addPosition)
        {
            var mapWaypointPrefab =
                ScenarioManager.Instance.GetExtension <ScenarioWaypointsManager>().waypointPrefab;

            newWaypointInstance = ScenarioManager.Instance.prefabsPools
                                  .GetInstance(mapWaypointPrefab).GetComponent <ScenarioWaypoint>();
            if (newWaypointInstance == null)
            {
                Debug.LogWarning(
                    $"Cannot add waypoints. Add {nameof(ScenarioWaypoint)} component to the prefab.");
                ScenarioManager.Instance.GetExtension <InputManager>().CancelAddingElements(this);
                return;
            }

            newWaypointInstance.ForceMove(addPosition);
            agentWaypoints.AddWaypoint(newWaypointInstance, true);
            isAddingWaypoints = true;
        }
 /// <inheritdoc/>
 void IAddElementsHandler.AddingMoved(Vector3 addPosition)
 {
     newWaypointInstance.ForceMove(addPosition);
 }