Esempio n. 1
0
        /// <summary>
        /// Wrapper to draw editors
        /// </summary>
        /// <param name="mapDecalInstance"></param>
        public void DrawEditor(MapDecalInstance mapDecalInstance)
        {
            if (!guiInitialized)
            {
                InitializeLayout();
                guiInitialized = true;
            }
            if (mapDecalInstance == null)
            {
                return;
            }

            if (selectedDecal != selectedDecalPrevious)
            {
                UpdateSelection(selectedDecal);
                selectedDecalPrevious = selectedDecal;
                position = selectedDecal.gameObject.transform.position;
                Planetarium.fetch.CurrentMainBody.GetLatLonAlt(position, out latitude, out longitude, out altitude);
                SetupVectors();
                EditorGizmo.SetupMoveGizmo(selectedDecal.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack);
                if (!KerbalKonstructs.camControl.active)
                {
                    KerbalKonstructs.camControl.enable(selectedDecal.gameObject);
                }
            }

            toolRect = GUI.Window(0xB00B1E3, toolRect, MapDecalEditorWindow, "", KKWindows);

            //if (editingLaunchSite)
            //{
            //    siteEditorRect = GUI.Window(0xB00B1E4, siteEditorRect, drawLaunchSiteEditorWindow, "", KKWindows);
            //}
        }
 public void Open()
 {
     SetActive(true);
     UpdateUI();
     Planetarium.fetch.CurrentMainBody.GetLatLonAlt(position, out latitude, out longitude, out altitude);
     EditorGizmo.SetupMoveGizmo(selectedDecal.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack);
     if (!KerbalKonstructs.camControl.active)
     {
         KerbalKonstructs.camControl.enable(selectedDecal.gameObject);
     }
 }
Esempio n. 3
0
 private void SetupGizmo()
 {
     origLocalPosition = selectedInstance.transform.localPosition;
     if (referenceSystem == Reference.Center)
     {
         EditorGizmo.SetupMoveGizmo(selectedInstance.gameObject, selectedInstance.transform.localRotation, OnMoveCB, WhenMovedCB);
     }
     else
     {
         EditorGizmo.SetupMoveGizmo(selectedInstance.gameObject, Quaternion.identity, OnMoveCB, WhenMovedCB);
     }
 }
Esempio n. 4
0
 public void Open()
 {
     UpdateUI();
     if (selectedObjectPrevious != selectedGroup)
     {
         selectedObjectPrevious = selectedGroup;
         EditorGizmo.SetupMoveGizmo(selectedGroup.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack);
         if (!KerbalKonstructs.camControl.active)
         {
             KerbalKonstructs.camControl.enable(selectedGroup.gameObject);
         }
     }
     SetActive(true);
 }
Esempio n. 5
0
        /// <summary>
        /// Wrapper to draw editors
        /// </summary>
        /// <param name="groupCenter"></param>
        internal void drawEditor(GroupCenter groupCenter)
        {
            if (groupCenter == null)
            {
                return;
            }

            if (selectedObjectPrevious != groupCenter)
            {
                selectedObjectPrevious = groupCenter;
                SetupVectors();
                UpdateStrings();
                EditorGizmo.SetupMoveGizmo(groupCenter.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack);
                if (!KerbalKonstructs.camControl.active)
                {
                    KerbalKonstructs.camControl.enable(groupCenter.gameObject);
                }
            }

            toolRect = GUI.Window(0xB07B1E3, toolRect, GroupEditorWindow, "", UIMain.KKWindow);
        }
 internal void UpdateMoveGizmo()
 {
     EditorGizmo.CloseGizmo();
     EditorGizmo.SetupMoveGizmo(selectedDecal.gameObject, Quaternion.identity, OnMoveCallBack, WhenMovedCallBack);
 }