Example #1
0
 //to handle different keyboard types (i.e. German and US);
 private static bool RotateKeys(Event e)
 {
     if (_rotateOptA)
     {
         if (e.character == 'z')
         {
             PreviewObject.RotateBackwards();
             return(true);
         }
         else if (e.character == 'x')
         {
             PreviewObject.RotateForwards();
             return(true);
         }
     }
     else
     {
         if (e.character == '>')
         {
             PreviewObject.RotateBackwards();
             return(true);
         }
         else if (e.character == '<')
         {
             PreviewObject.RotateForwards();
             return(true);
         }
     }
     return(false);
 }
Example #2
0
        public static void CreateGameObject(Vector3 position)
        {
            var gameObject = PreviewObject.CreateGameObject();

            gameObject.transform.position = position;
            gameObject.transform.parent   = MapEditorMap.CurrentSubSection;

            Undo.RegisterCreatedObjectUndo(gameObject, "Create " + gameObject.name);
        }
Example #3
0
        public static void CreateGameObject(int x, int y)
        {
            var gameObject = PreviewObject.CreateGameObject();

            gameObject.transform.position = new Vector3(x, y, 0);
            gameObject.transform.MoveToSection(Matrix.Matrix.At(x, y).Section, MapEditorMap.CurrentSubSectionName);

            Undo.RegisterCreatedObjectUndo(gameObject, "Create " + gameObject.name);
        }
Example #4
0
        public static void OnSceneGUI(SceneView sceneView)
        {
            if (EnableEdit)
            {
                PreviewObject.SetActive(true);
                PreviewObject.Update(sceneView);
                InputControl.ReactInput(sceneView);

                UnselectMapReference();
            }
            else
            {
                PreviewObject.SetActive(false);
            }
        }