Пример #1
0
 void FocusObjMode()
 {
     using (new EditorGUILayout.HorizontalScope())
     {
         var iconButtonOptions = new[] { GUILayout.Height(30), GUILayout.Width(30) };
         CameraMoveEdGUI.FaceIconButtonFront(
             () => SetCameraPos(CameraPoint.Front),
             iconButtonOptions
             );
         CameraMoveEdGUI.FaceIconButtonLeft(() => SetCameraPos(CameraPoint.Left), iconButtonOptions);
         CameraMoveEdGUI.FaceIconButtonRight(() => SetCameraPos(CameraPoint.Right), iconButtonOptions);
         CameraMoveEdGUI.BodyIconButton(() => SetCameraPos(CameraPoint.Body), iconButtonOptions);
     }
 }
Пример #2
0
        void OnGUI()
        {
            EditorGUILayout.LabelField("カメラを動かすツール");
            // Wait for user to select a GameObject
            if (go == null)
            {
                EditorGUILayout.HelpBox("Please select a Camera", MessageType.Info);
                return;
            }

            CameraMoveEdGUI.UseSkin();
            using (new EditorGUILayout.HorizontalScope(GUI.skin.box, GUILayout.Height(85)))
            {
                using (new EditorGUILayout.VerticalScope(GUI.skin.box, GUILayout.MinWidth(270)))
                {
                    using (new EditorGUILayout.HorizontalScope())
                    {
                        EditorGUILayout.LabelField("MoveType", GUILayout.Width(80));
                        currentMoveType = (MoveType)EditorGUILayout.EnumPopup(currentMoveType);
                    }

                    using (new EditorGUILayout.HorizontalScope())
                    {
                        GUILayout.FlexibleSpace();
                        lockSelection = GUILayout.Toggle(lockSelection, "Lock");
                    }
                    using (new EditorGUILayout.HorizontalScope())
                    {
                        EditorGUILayout.LabelField("Camera", GUILayout.Width(80));
                        go = EditorGUILayout.ObjectField(go, typeof(GameObject), true) as GameObject;
                    }

                    if (currentMoveType == MoveType.Focus)
                    {
                        using (new EditorGUILayout.HorizontalScope())
                        {
                            EditorGUILayout.LabelField("FocusTarget", GUILayout.Width(80));
                            focusObj = EditorGUILayout.ObjectField(focusObj, typeof(GameObject), true) as GameObject;
                        }
                    }
                    GUILayout.FlexibleSpace();
                }
                using (new EditorGUILayout.VerticalScope(GUI.skin.box))
                {
                    if (currentMoveType == MoveType.Focus)
                    {
                        FocusObjMode();
                    }
                    using (new EditorGUILayout.HorizontalScope())
                    {
                        if (GUILayout.Button("Z0", GUILayout.Height(30), GUILayout.Width(30)))
                        {
                            go.transform.rotation = Quaternion.Euler(
                                go.transform.eulerAngles.x,
                                go.transform.eulerAngles.y,
                                0
                                );
                        }

                        GUILayout.FlexibleSpace();
                    }

                    GUILayout.FlexibleSpace();
                }
            }
            //入力
            EditorInput();


            using (new EditorGUILayout.HorizontalScope(GUI.skin.box))
            {
                GUILayout.FlexibleSpace();
                using (new EditorGUILayout.VerticalScope())
                {
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.LabelField("ここで動かす");
                    GUILayout.FlexibleSpace();
                }
                GUILayout.FlexibleSpace();
            }
        }