Beispiel #1
0
 public void AddWaypointMarker(WaypointMarker wp)
 {
     if (!waypointMarkersList.Contains(wp))
     {
         SubscribeOnDestruction(wp.GetInstanceID().ToString(), () => RemoveWaypointMarker(wp));
         this.waypointMarkersList.Add(wp);
     }
 }
Beispiel #2
0
 private void RemoveWaypointMarker(WaypointMarker wp)
 {
     if (waypointMarkersList.Contains(wp))
     {
         waypointMarkersList.Remove(wp);
         UnsubscribeOnDestruction(wp.GetInstanceID().ToString());
         wp.DestroyThis();
     }
 }
        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);
        }
Beispiel #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();
                    }
                }
            }
        }