Esempio n. 1
0
    void OnGUI_PanoramaPropControl()
    {
        EditorGUILayout.BeginVertical();
        DanbiController.PushSpace(3);



        DanbiController.PushSpace(3);
        EditorGUILayout.EndVertical();
    }
Esempio n. 2
0
    /// <summary>
    /// TODO:
    /// </summary>
    void OnGUI_DisplayMainTitle()
    {
        EditorGUILayout.BeginVertical();
        // 1. Declare GUIStyle for the main title.
        var styleLabel = new GUIStyle(GUI.skin.label);

        //styleForResoultionLabel.alignment = TextAnchor.MiddleCenter;
        styleLabel.fontSize    = 60;
        styleLabel.alignment   = TextAnchor.UpperCenter;
        styleLabel.fixedHeight = 600;

        DanbiController.PushSpace(3);
        // 2. Draw LabelField.
        EditorGUILayout.LabelField("Danbi Controller", styleLabel);

        DanbiController.PushSpace(12);
        EditorGUILayout.EndVertical();
    }
Esempio n. 3
0
    /// <summary>
    /// TODO:
    /// </summary>
    void OnGUI_ChoosePrewarper()
    {
        EditorGUILayout.BeginVertical();
        EditorGUI.BeginChangeCheck();
        DanbiController.PushSpace(6);

        // 1. Start to draw Enum Popup.
        CurrentPrewarperType = (EDanbiPrewarperType)EditorGUILayout.EnumPopup("Prewarper Type ", CurrentPrewarperType);
        DanbiController.PushSpace(6);

        // 2. If there's dirty on the Enum Popup,
        if (EditorGUI.EndChangeCheck())
        {
            // 3. Invoke the delegate that is linked to change the current prewarper.
            DanbiFwdObjects.PrewarperActivatorAction.Invoke(CurrentPrewarperType);
            // 4. Update all the linked references.
            DanbiFwdObjects.Cams = FindObjectsOfType <Camera>();
            foreach (var cam in DanbiFwdObjects.Cams)
            {
                Debug.Log($"{cam.name} is selected! number of cameras : {DanbiFwdObjects.Cams.Length}.");
            }
        }
        EditorGUILayout.EndVertical();
    }
Esempio n. 4
0
    void OnGUI_RayTracerMasterControl()
    {
        #region Push line separator
        EditorGUILayout.BeginVertical();
        DanbiController.PushSpace(3);
        EditorGUILayout.LabelField("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
        DanbiController.PushSpace(3);
        EditorGUILayout.EndVertical();
        #endregion

        // 1. Draw texture picker
        EditorGUI.BeginChangeCheck();
        EditorGUILayout.BeginHorizontal();
        GUILayout.BeginVertical();

        var styleTexturePicker = new GUIStyle(GUI.skin.box);
        styleTexturePicker.alignment  = TextAnchor.UpperCenter;
        styleTexturePicker.fixedWidth = 150;

        DanbiFwdObjects.TargetTex = (EditorGUILayout.ObjectField(obj: DanbiFwdObjects.TargetTex,
                                                                 objType: typeof(Texture2D),
                                                                 allowSceneObjects: true,
                                                                 options: new GUILayoutOption[] { GUILayout.Width(150), GUILayout.Height(150) }))
                                    as Texture2D;
        GUILayout.EndVertical();
        EditorGUILayout.EndHorizontal();

        // 2. when the texture has been picked,
        if (EditorGUI.EndChangeCheck())
        {
            var fwd = FindObjectsOfType <RayTracingMaster>();
            if (fwd.Length != 1)
            {
                Debug.LogError("Only One Prewarper is allowed at the same time!");
                return;
            }
            DanbiFwdObjects.RTMaster = fwd[0];
            DanbiFwdObjects.RTMaster.targetPanoramaTex = DanbiFwdObjects.TargetTex;
            DanbiFwdObjects.RTMaster.ApplyNewTargetTexture(bCalledOnValidate: false, newTargetTex: ref DanbiFwdObjects.TargetTex);
            EditorUtility.SetDirty(DanbiFwdObjects.RTMaster);
            EditorUtility.SetDirty(DanbiFwdObjects.TargetTex);
        }

        EditorGUILayout.BeginVertical();
        // 3. Declare GUIStyle for the texture info indicator.
        var styleLabelTextureInfoIndicator = new GUIStyle(GUI.skin.label);
        styleLabelTextureInfoIndicator.fontSize    = 40;
        styleLabelTextureInfoIndicator.alignment   = TextAnchor.UpperCenter;
        styleLabelTextureInfoIndicator.fixedHeight = 300;

        // 4. draw the texture info indicator.
        var errorStr = "Select Texture!!!!!";
        var tempStr  = DanbiFwdObjects.TargetTex ? DanbiFwdObjects.TargetTex.name : errorStr;
        EditorGUILayout.LabelField($"{tempStr}", styleLabelTextureInfoIndicator);
        DanbiController.PushSpace(6);

        styleLabelTextureInfoIndicator.fontSize = 30;

        tempStr = DanbiFwdObjects.TargetTex ? $"Actual Resolution : {DanbiFwdObjects.TargetTex.width} x {DanbiFwdObjects.TargetTex.height}" : errorStr;
        EditorGUILayout.LabelField(tempStr, styleLabelTextureInfoIndicator);
        DanbiController.PushSpace(6);

        styleLabelTextureInfoIndicator.fontSize = 12;
        tempStr = DanbiFwdObjects.TargetTex ? $"Location : {AssetDatabase.GetAssetPath(DanbiFwdObjects.TargetTex)}" : errorStr;
        EditorGUILayout.LabelField(tempStr, styleLabelTextureInfoIndicator);
        DanbiController.PushSpace(6);

        #region Push line separator
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
        EditorGUILayout.Space();
        EditorGUILayout.EndVertical();
        #endregion
    }