Пример #1
0
    public static void Inspector(StarburstField sf)
    {
        GuiTools.DrawTitleChapter("Starburst",12,true,0,Screen.width,Color.white);

        if (GUILayout.Button(new GUIContent(" Add starburst",CosmosInspector.GetIcon(13)))){
            AddStarburst();
            GuiTools.SetSceneCamera( 0,0);
        }

        EditorGUILayout.Space();

        if (GUILayout.Button(new GUIContent(" Random starburst",CosmosInspector.GetIcon(21)))){
            RandomStarburstField(sf);
        }

        if (GUILayout.Button(new GUIContent(" Random color",CosmosInspector.GetIcon(14)))){
            sf.RandomColor();
        }

        GuiTools.DrawSeparatorLine();

        StarBurst[] starbursts = sf.GetComponentsInChildren<StarBurst>();
        int i=0;
        while (i<starbursts.Length){
            StarburstProperties(starbursts[i]);
            i++;
        }

        GuiTools.DrawSeparatorLine();

        // Delete All
        if (GUILayout.Button( new GUIContent( " Clear",CosmosInspector.GetIcon(12)))){
            if (EditorUtility.DisplayDialog( "Delete all starburst","Are you sure ?","Delete","Cancel")){
                sf.ClearStarbursts();
            }

        }
    }
Пример #2
0
    public static void RandomStarburstField(StarburstField sf)
    {
        sf.ClearStarbursts();

        int randomCount = Random.Range(0,20);
        for(int s=0;s<randomCount;s++){
            AddStarburst( true);
        }
    }