Ejemplo n.º 1
0
 public void AddWaypointMarker(WaypointMarker wp)
 {
     if (!waypointMarkersList.Contains(wp))
     {
         SubscribeOnDestruction(wp.GetInstanceID().ToString(), () => RemoveWaypointMarker(wp));
         this.waypointMarkersList.Add(wp);
     }
 }
Ejemplo n.º 2
0
 private void RemoveWaypointMarker(WaypointMarker wp)
 {
     if (waypointMarkersList.Contains(wp))
     {
         waypointMarkersList.Remove(wp);
         UnsubscribeOnDestruction(wp.GetInstanceID().ToString());
         wp.DestroyThis();
     }
 }
Ejemplo n.º 3
0
        public static WaypointMarker CreateWaypointMarker(Vector3 worldPosition)
        {
            WaypointMarker res = Instantiate <WaypointMarker>(
                GameObject.Find("ResourcesList").GetComponent <ResourcesListComponent>().waypointMarkerPrefab,
                GameObject.Find("UI World Canvas").transform);

            res.Init(worldPosition);

            return(res);
        }
Ejemplo n.º 4
0
        private void OnPointerClickDelegate(PointerEventData data)
        {
            if (!paused)
            {
                if (isEditing)
                {
                    if (UIHandler.EventSystemPointedGameObjects().Count > 1)
                    {
                        ExitPlacementUIMode();
                        ConfirmPositioning(false);
                        DestroyThis();
                    }
                    else
                    {
                        AddWaypointMarker(WaypointMarker.CreateWaypointMarker(GetWorldPosition()));

                        ExitPlacementUIMode();
                        ConfirmPositioning(true);
                    }
                }
                else
                {
                    if (expanded)
                    {
                        SelectionHandler.GetUsedSelector().DeselectEntity(this);
                        expanded = false;
                        //Contract();
                    }
                    else
                    {
                        SelectionHandler.GetUsedSelector().SelectEntity(this);
                        expanded = true;
                        //Expand();
                    }
                }
            }
        }