Exemple #1
0
        protected string GetHandlerName(FW_ObjectType type)
        {
            var tempName = ("" + type).Split('.');

            return(tempName[tempName.Length - 1]);
        }
Exemple #2
0
        void OnGUI()
        {
            minSize = new Vector2(100, 36);
            maxSize = new Vector2(800, 36);

            rect = GUILayoutUtility.GetRect(32, 32);
            Outer.RectResize(ref rect, 3, 3, 32, 32);

            if (GUI.Button(rect, new GUIContent(texBtnHighlight, "Highlight in Hierarchy")))
            {
                HighlightInHierarchy();
            }

            Outer.RectTune(ref rect, 34, 0, 0, 0);
            if (GUI.Button(rect, new GUIContent(texBtnCopy, "Copy transforms")))
            {
                CopyTransform();
            }

            Outer.RectTune(ref rect, 34, 0, 0, 0);
            if (GUI.Button(rect, new GUIContent(texBtnPaste, "Paste transforms")))
            {
                PasteTransform();
            }

//            Outer.RectTune(ref rect, 34, 0, 0, 0);
//            if (GUI.Button(rect, new GUIContent("><", "Disconnect this object from prefab")))
//            {
//                DisconnectPrefab();
//            }

            Outer.RectTune(ref rect, 50, 0, -20, 0);
            EditorGUI.LabelField(rect, "T    R    S ");

            Outer.RectResize(ref rect, 0, 15, 16, 16);
            bPos = EditorGUI.Toggle(rect, bPos);

            Outer.RectTune(ref rect, 23, 0, 0, 0);
            bRot = EditorGUI.Toggle(rect, bRot);

            Outer.RectTune(ref rect, 23, 0, 0, 0);
            bScale = EditorGUI.Toggle(rect, bScale);


            Outer.RectResize(ref rect, 32, -15, 32, 32);
            if (GUI.Button(rect, new GUIContent(texBtnRotateY, "Random panning")))
            {
                RotateTransform();
            }
            Outer.RectTune(ref rect, 34, 0, 0, 0);
            if (GUI.Button(rect, new GUIContent(texBtnByZero, "Up-axis looks out from the world zero")))
            {
                OrientByZero();
            }

            Outer.RectTune(ref rect, 34, 0, 0, 0);
            if (GUI.Button(rect, new GUIContent(texBtnToTheGround, "Drop to the ground")))
            {
                DropToTheGround();
            }

            Outer.RectResize(ref rect, 40, 0, 40, 32);
            randomScaleMin = EditorGUI.FloatField(rect, Mathf.Clamp(randomScaleMin, 0.1f, randomScaleMax), styleNull);

            Outer.RectResize(ref rect, 40, 0, 32, 32);
            if (GUI.Button(rect, new GUIContent(texBtnRandomScale, "Random scaling")))
            {
                RandomScale();
            }

            Outer.RectResize(ref rect, 32, 0, 40, 32);
            randomScaleMax = EditorGUI.FloatField(rect, Mathf.Clamp(randomScaleMax, randomScaleMin, 4f), styleNull);

            Outer.RectResize(ref rect, 32, 0, 32, 32);
            if (GUI.Button(rect, new GUIContent(texBtnMesh2Prefab, "Export mesh to prefab")))
            {
                ExportMesh();
            }

            //        GUI.backgroundColor = VRCheck();
            //        Outer.RectResize(ref rect, 60, 0, 32, 32);
            //        if (GUI.Button(rect, new GUIContent("VR\n" + (virtualRealitySupported ? "on" : "off"), "Virtual Reality Supported")))
            //        {
            //            virtualRealitySupported = !virtualRealitySupported;
            //            PlayerSettings.virtualRealitySupported = virtualRealitySupported;
            //        }

            //        GUI.backgroundColor = colorOn;
            //        Outer.RectResize(ref rect, 60, 0, 48, 32);
            //        if (GUI.Button(rect, new GUIContent("Build\nVR on", "Build & Run VR scene")))
            //        {
            //            BuildCurrentScene(true);
            //        }
            //
            //        GUI.backgroundColor = colorOff;
            //        Outer.RectResize(ref rect, 60, 0, 48, 32);
            //        if (GUI.Button(rect, new GUIContent("Build\nVR off", "Build & Run scene")))
            //        {
            //            BuildCurrentScene(false);
            //        }

            //        GUI.backgroundColor = Color.white;

            Outer.RectResize(ref rect, 50, 0, 56, 32);
            if (GUI.Button(rect, new GUIContent("Settings")))
            {
//                EditorApplication.ExecuteMenuItem("Edit/Preferences...");
//                EditorApplication.ExecuteMenuItem("GameObject/3D Object/Cube");
                EditorApplication.ExecuteMenuItem("Edit/Project Settings...");
//                EditorApplication.ExecuteMenuItem("Edit/Project Settings.../Player");
//                EditorApplication.ExecuteMenuItem("Edit/Project Settings");
            }

//            Outer.RectResize(ref rect, 48, 0, 46, 32);
//            if (GUI.Button(rect, new GUIContent("GFX")))
//            {
//                EditorApplication.ExecuteMenuItem("Edit/Project Settings/Graphics");
//            }
//
//            Outer.RectResize(ref rect, 48, 0, 46, 32);
//            if (GUI.Button(rect, new GUIContent("Input")))
//            {
//                EditorApplication.ExecuteMenuItem("Edit/Project Settings/Input");
//            }

            Outer.RectResize(ref rect, 80, 0, 100, 16);
            holderType          = (FW_ObjectType)EditorGUI.EnumPopup(rect, holderType);
            GUI.backgroundColor = colorAction;
            Outer.RectTune(ref rect, 0, 16, 0, 0);
            if (GUI.Button(rect, "Create or Ping"))
            {
                CreateFWSDKHandler();
            }


            GUI.backgroundColor = Color.white;

            Outer.RectResize(ref rect, 104, -16, 100, 16);
            animationClip2Export =
                (AnimationClip)EditorGUI.ObjectField(rect, animationClip2Export, typeof(AnimationClip), true);
            GUI.backgroundColor = colorOn;
            Outer.RectTune(ref rect, 0, 16, -18, 0);
            if (GUI.Button(rect, "Clip 2 .anim"))
            {
                ExportClip2AnimAsset();
            }

            GUI.backgroundColor = CacheServerCheck();
            Outer.RectResize(ref rect, 90, -16, 128, 32);
            GUI.Box(rect, "CacheServer\nis " + (cacheServerIsOn ? "ON" : "OFF"));
        }