Ejemplo n.º 1
0
    public static void StarboxInspector( StarfieldBox sb,string label, int type)
    {
        sb.inspectorShowProperties = GuiTools.ChildFoldOut(sb.inspectorShowProperties,label,new Color(183f/255f,230f/255f,252f/255f),Screen.width-40);

        if (sb.inspectorShowProperties){
            EditorGUI.indentLevel++;

            sb.Enable = GuiTools.Toggle("Enable",sb.Enable);
            EditorGUILayout.Space();

            // Cluster
            sb.ClusterCount = EditorGUILayout.IntSlider( "Starcluster", sb.ClusterCount ,1,50);

            sb.Mixing = EditorGUILayout.Slider("Mixing",sb.Mixing,0f,1f);

            EditorGUILayout.Space();

            //star
            if (type==0){

                if (GradientField("starfield.cosmosStarfield.gradient")){
                    SpaceBox.instance.starfield.Render();
                }
                sb.Intensity = EditorGUILayout.Slider("Intensity",sb.Intensity,0f,2f);
            }
            else{

                if (GradientField("starfield.nebulaStarfield.gradient")){
                    SpaceBox.instance.starfield.Render();
                }
                sb.Intensity = EditorGUILayout.Slider("Intensity",sb.Intensity,1f,20f);
            }

            if (type==0){
                sb.Threshold = EditorGUILayout.Slider("Threshold",sb.Threshold,0,0.5f);
            }
            else{
                sb.Threshold = EditorGUILayout.Slider("Threshold",sb.Threshold,0f,0.5f);
            }

            EditorGUILayout.Space();

            sb.SmallCount = EditorGUILayout.IntSlider("Small start",sb.SmallCount,0,16000);
            sb.MediumCount = EditorGUILayout.IntSlider("Medium start",sb.MediumCount,0,2400);
            sb.LargeCount = EditorGUILayout.IntSlider("Large start",sb.LargeCount,0,1000);

            EditorGUI.indentLevel--;

        }
    }
Ejemplo n.º 2
0
        public void Create()
        {
            rendered = false;

            // Init texture;
            quality = StarfieldQuality.Medium;
            starfieldTexture = new Texture2D[6];

            nebulaStarfield = new StarfieldBox();
            nebulaStarfield.Create();

            cosmosStarfield = new StarfieldBox();
            cosmosStarfield.Create();
        }