Esempio n. 1
0
    public override void OnInspectorGUI()
    {
        DemoScreenEffects s = (DemoScreenEffects)target;

        //DrawDefaultInspector();

        if (Application.isPlaying)
        {
            GUILayout.Space(25);
            if (GUILayout.Button("Clear Effects"))
            {
                ScreenEffects.Clear();
            }
            GUILayout.Space(25);
        }

        //==============================
        //KEYHOLE
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.LabelField("Keyhole", EditorStyles.boldLabel);

        GUILayout.Space(10);

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Keyhole"))
            {
                s.DemoKeyhole();
            }
        }

        EditorGUILayout.PropertyField(demoKey_keyholeProp, new GUIContent("Keyhole Prefab:"));
        EditorGUILayout.PropertyField(demoKey_ColProp, new GUIContent("Color:"));
        EditorGUILayout.PropertyField(demoKey_AnimProp, new GUIContent("Animation Curve:"));
        EditorGUILayout.PropertyField(demoKey_fTimeProp, new GUIContent("Time"));
        EditorGUILayout.PropertyField(demoKey_targetProp, new GUIContent("Worldspace Target"));
        EditorGUILayout.PropertyField(demoKey_bIsEnteringProp, new GUIContent("Keyhole entering?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        //==============================
        //AXIAL TILING
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.LabelField("Axial Tiling", EditorStyles.boldLabel);



        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Axial Tiling"))
            {
                s.DemoTileScreen();
            }
        }

        EditorGUILayout.PropertyField(demoStandard_colProp, new GUIContent("Tile color:"));
        EditorGUILayout.PropertyField(demoStandard_iNumRowsProp, new GUIContent("Number of rows:"));
        EditorGUILayout.PropertyField(demoStandard_fDelayProp, new GUIContent("Delay between tiles:"));
        EditorGUILayout.PropertyField(demoStandard_bIsLeftProp, new GUIContent("Start on the left?"));
        EditorGUILayout.PropertyField(demoStandard_bIsBottomProp, new GUIContent("Start at the bottom?"));
        EditorGUILayout.PropertyField(demoStandard_bFillColumnsFirstProp, new GUIContent("Fill vertically?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        //==============================
        //DIAGONAL TILING
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);
        EditorGUILayout.LabelField("Diagonal Tiling", EditorStyles.boldLabel);
        GUILayout.Space(10);

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Diagonal Tiling"))
            {
                s.DemoTileScreenDiagonally();
            }
        }

        EditorGUILayout.PropertyField(demoDiag_colProp, new GUIContent("Tile color:"));
        EditorGUILayout.PropertyField(demoDiag_iNumRowsProp, new GUIContent("Number of rows:"));
        EditorGUILayout.PropertyField(demoDiag_fDelayProp, new GUIContent("Delay between tiles:"));
        EditorGUILayout.PropertyField(demoDiag_bIsLeftProp, new GUIContent("Start on the left?"));
        EditorGUILayout.PropertyField(demoDiag_bIsBottomProp, new GUIContent("Start at the bottom?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        //==============================
        //HORIZONTAL BANNERS
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.LabelField("Horizontal Banners", EditorStyles.boldLabel);

        GUILayout.Space(10);

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Horizontal Banners"))
            {
                s.DemoHorizontalBanners();
            }
        }

        EditorGUILayout.PropertyField(demoHorBan_colProp, new GUIContent("Banner color:"));
        EditorGUILayout.PropertyField(demoHorBan_animCurveProp, new GUIContent("Animation Curve:"));
        EditorGUILayout.PropertyField(demoHorBan_iNumBanProp, new GUIContent("Number of banners:"));
        EditorGUILayout.PropertyField(demoHorBan_fAcrossTimeProp, new GUIContent("Time for one banner to cross:"));
        EditorGUILayout.PropertyField(demoHorBan_fDelayProp, new GUIContent("Delay between banners:"));
        EditorGUILayout.PropertyField(demoHorBan_bIsLeftProp, new GUIContent("Start on the left?"));
        EditorGUILayout.PropertyField(demoHorBan_bIsTopProp, new GUIContent("Start at the top?"));
        EditorGUILayout.PropertyField(demoHorBan_bIsEnteringProp, new GUIContent("Banners entering?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        //==============================
        //VERTICAL BANNERS
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.LabelField("Vertical Banners", EditorStyles.boldLabel);

        GUILayout.Space(10);

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Vertical Banners"))
            {
                s.DemoVerticalBanners();
            }
        }

        EditorGUILayout.PropertyField(demoVerBan_colProp, new GUIContent("Banner color:"));
        EditorGUILayout.PropertyField(demoVerBan_animCurveProp, new GUIContent("Animation Curve:"));
        EditorGUILayout.PropertyField(demoVerBan_iNumBanProp, new GUIContent("Number of banners:"));
        EditorGUILayout.PropertyField(demoVerBan_fAcrossTimeProp, new GUIContent("Time for one banner to cross:"));
        EditorGUILayout.PropertyField(demoVerBan_fDelayProp, new GUIContent("Delay between banners:"));
        EditorGUILayout.PropertyField(demoVerBan_bIsLeftProp, new GUIContent("Start on the left?"));
        EditorGUILayout.PropertyField(demoVerBan_bIsTopProp, new GUIContent("Start at the top?"));
        EditorGUILayout.PropertyField(demoVerBan_bIsEnteringProp, new GUIContent("Banners entering?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        //==============================
        //BARS
        //==============================

        GUILayout.BeginVertical(EditorStyles.helpBox);

        EditorGUILayout.LabelField("Bars", EditorStyles.boldLabel);

        GUILayout.Space(10);

        if (Application.isPlaying)
        {
            if (GUILayout.Button("Demo Bars"))
            {
                s.DemoBars();
            }
        }

        EditorGUILayout.PropertyField(demoBar_colProp, new GUIContent("Bar color:"));
        EditorGUILayout.PropertyField(demoBar_animCurveProp, new GUIContent("Animation Curve:"));
        EditorGUILayout.PropertyField(demoBar_fTimeProp, new GUIContent("Total time:"));
        EditorGUILayout.PropertyField(demoBar_fProportionProp, new GUIContent("Proportion of screen filled by one banner:"));
        EditorGUILayout.PropertyField(demoBar_bIsHorizontalProp, new GUIContent("Horizontal banners?"));
        EditorGUILayout.PropertyField(demoBar_bIsEnteringProp, new GUIContent("Banners entering?"));

        GUILayout.EndVertical();

        GUILayout.Space(25);

        serializedObject.ApplyModifiedProperties();
    }