示例#1
0
    /////////////////////////////////////

    public override void OnInspectorGUI()
    {
        //////////РИСУЕМ ЛОГО ////////////
        if (m_Logo != null)
        {
            GUILayout.BeginVertical(m_Background1);
            Rect rect = GUILayoutUtility.GetRect(m_Logo.width, m_Logo.height);
            GUI.DrawTexture(rect, m_Logo, ScaleMode.ScaleToFit);
            GUILayout.EndVertical();
        }
        ///////////////////////////////////////////
        GUI.color           = Color.green;  //Цвет интерфейса
        GUI.backgroundColor = Color.green;
        ///////Версия продукта////////////
        GUILayout.BeginVertical(m_Background1);
        EditorGUILayout.HelpBox("Version 1.1                           Kryzhan.ru © 2016", MessageType.None);
        GUILayout.EndVertical();
        ////////////////////////////////////
        GUI.color           = Color.white; //Цвет интерфейса
        GUI.backgroundColor = Color.white;

        //////////САМОЕ ГЛАВНОЕ - СВЯЗЬ СКРИПТОВ,GRASS можно задать своё, tаrget - не менять////////////
        UsPgAuto Grass = (UsPgAuto)target;

        //////////////////////////////////
        ////////БЛОК СТИЛЯ ПАРАМЕТРОВ//////////
        GUILayout.BeginVertical(m_Background1);
        GUILayout.BeginVertical("Box");
        GUILayout.BeginHorizontal("Box");
        GUILayout.BeginHorizontal(m_Background1);
        GUILayout.Label("                Grass settings", EditorStyles.boldLabel);
        GUILayout.EndHorizontal();
        GUILayout.EndHorizontal();
        ////////БЛОК СТИЛЯ ПАРАМЕТРОВ//////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical("Box");
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.GeneralGrassTint = EditorGUILayout.ColorField("Grass tone", Grass.GeneralGrassTint);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_detailSeed = EditorGUILayout.IntField(" ", Grass.m_detailSeed);
        EditorGUILayout.HelpBox("Constanta variety - the number of unique value which will spawn the grass in different places in different ways.", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_detailFrq = EditorGUILayout.FloatField(" ", Grass.m_detailFrq);
        EditorGUILayout.HelpBox("Grass Distribution - this parameter is responsible for the quality of the grass applied to the earth surface", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_noiseSpread = EditorGUILayout.FloatField(" ", Grass.m_noiseSpread);
        EditorGUILayout.HelpBox("A variety of Grass - this option displays the variation in the height and width of the grass", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_detailObjectDistance = EditorGUILayout.IntField(" ", Grass.m_detailObjectDistance);
        EditorGUILayout.HelpBox("Range rendering grass on the map", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_minWidth = EditorGUILayout.FloatField(" ", Grass.m_minWidth);
        EditorGUILayout.HelpBox("The minimum width of the sprite grass", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_maxWidth = EditorGUILayout.FloatField(" ", Grass.m_maxWidth);
        EditorGUILayout.HelpBox("The maximum width of the sprite grass", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_minHeight = EditorGUILayout.FloatField(" ", Grass.m_minHeight);
        EditorGUILayout.HelpBox("The minimum height of the sprite grass", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_maxHeight = EditorGUILayout.FloatField(" ", Grass.m_maxHeight);
        EditorGUILayout.HelpBox("The maximum height of the sprite grass", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        EditorGUILayout.Space();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_waterHeight = EditorGUILayout.FloatField(" ", Grass.m_waterHeight);
        EditorGUILayout.HelpBox("The height of the water - indicating the height underneath the grass will not be rendered", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_cliffHeight = EditorGUILayout.FloatField(" ", Grass.m_cliffHeight);
        EditorGUILayout.HelpBox("The height of the snow cliff - over this height value grass no rendering", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.m_detailObjectDensity = EditorGUILayout.FloatField(" ", Grass.m_detailObjectDensity);
        EditorGUILayout.HelpBox("Density - Grass Density", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.Repiter = EditorGUILayout.IntField(" ", Grass.Repiter);
        EditorGUILayout.HelpBox("Repiter - value of Raytracers, must be = Resolution", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.Resolution = EditorGUILayout.FloatField(" ", Grass.Resolution);
        EditorGUILayout.HelpBox("Resolution - grid of raytracers , lower value = better quality . 60 = best perfomance", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();
        ////////////////////////////
        GUILayout.BeginVertical(Depthstyle);
        GUILayout.BeginVertical(Depthstyle);
        Grass.RAYTRASSA = EditorGUILayout.FloatField(" ", Grass.RAYTRASSA);
        EditorGUILayout.HelpBox("RAY Zone - Zone of no grass , if you use Resolution = 1 , RAY Zone must by = 1 , default value 150 ", MessageType.None);
        GUILayout.EndVertical();
        GUILayout.EndVertical();

        GUILayout.EndHorizontal();
        GUILayout.EndHorizontal();

        GUILayout.EndVertical();
        GUILayout.EndVertical();

        GUILayout.BeginVertical(m_Background1);
        EditorGUILayout.Space();
        GUI.color = Color.cyan;
        if (GUILayout.Button("Visit our website", EditorStyles.miniButtonMid))
        {
            Application.OpenURL("http://kryzhan.ru");
        }
        GUILayout.EndVertical();
//
    }
示例#2
0
    void Update()
    {
//	   UsPg USPG_API = GetComponent<UsPg>();
        UsPgAuto USPG_AUTOAPI = GetComponent <UsPgAuto>();

////////////////////////////////////////////////////////////
/////////////      USPG_AUTO_API SETTINGS       ////////////
////////////////////////////////////////////////////////////

//Main Settings//
        USPG_AUTOAPI.m_detailSeed               = 666999666;
        USPG_AUTOAPI.m_detailFrq                = 2.0f;
        USPG_AUTOAPI.m_noiseSpread              = 256f;
        USPG_AUTOAPI.m_detailObjectDistance     = 200;
        USPG_AUTOAPI.m_detailObjectDensity      = 0.06f;
        USPG_AUTOAPI.m_wavingGrassSpeed         = 1f;
        USPG_AUTOAPI.m_wavingGrassSize          = 1f;
        USPG_AUTOAPI.m_wavingGrassBending       = 0.21f;
        USPG_AUTOAPI.m_detailResolutionPerPatch = 128;

//Color Settings//
///*
        USPG_AUTOAPI.GeneralGrassTint = new Color32(0, 100, 255, 255);     //default (214, 214, 214, 255);  //red (255, 0, 0, 255); //Blue (0, 100, 255, 255); //niceblue (0, 255, 230, 255); //Green (0, 255, 0, 255); //Yellow (0, 255, 255, 255); //Orange (0, 150, 255, 255); //Magenta (255, 0, 255, 255); //Pink (255, 0, 130, 255);

        USPG_AUTOAPI.grassHealthyColor0 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor0     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
        USPG_AUTOAPI.grassHealthyColor1 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor1     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
        USPG_AUTOAPI.grassHealthyColor2 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor2     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
        USPG_AUTOAPI.grassHealthyColor3 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor3     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
        USPG_AUTOAPI.grassHealthyColor4 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor4     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
        USPG_AUTOAPI.grassHealthyColor5 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
        USPG_AUTOAPI.grassDryColor5     = new Color32(111, 146, 91, 255);  //default(111, 146, 91, 255);
//*/

/* //RED GRASS
 *
 * USPG_AUTOAPI.GeneralGrassTint = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor0 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor0 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor1 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor1 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor2 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor2 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor3 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor3 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor4 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor4 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassHealthyColor5 = new Color32(255, 0, 0, 255);
 * USPG_AUTOAPI.grassDryColor5 = new Color32(255, 0, 0, 255);
 *
 */

//Grass settings Size//
        USPG_AUTOAPI.m_minWidth  = 3f;
        USPG_AUTOAPI.m_maxWidth  = 4f;
        USPG_AUTOAPI.m_minHeight = 0.5f;
        USPG_AUTOAPI.m_maxHeight = 1f;

//No Grass Places Settings//
        USPG_AUTOAPI.m_waterHeight = 15;
        USPG_AUTOAPI.m_cliffHeight = 500;

// Grass Hole Raytracer settings//
        USPG_AUTOAPI.Repiter    = 60;
        USPG_AUTOAPI.Resolution = 60f;
        USPG_AUTOAPI.Height     = 100000;
        USPG_AUTOAPI.RAYTRASSA  = 150;

////////////////////////////////////////////////////////////
//////////////      USPG_API SETTINGS       ////////////////
////////////////////////////////////////////////////////////

/*
 *
 * ///////Main Settings//////
 * USPG_API.m_detailSeed = 666999666;
 * USPG_API.m_detailFrq = 2.0f;
 * USPG_API.m_noiseSpread = 256f;
 * USPG_API.m_detailObjectDistance = 200;
 * USPG_API.m_detailObjectDensity = 0.06f;
 * USPG_API.m_wavingGrassSpeed = 1f;
 * USPG_API.m_wavingGrassSize = 1f;
 * USPG_API.m_wavingGrassBending = 0.21f;
 * USPG_API.m_detailResolutionPerPatch = 128;
 *
 * //////Color Settings///////
 * USPG_API.GeneralGrassTint = new Color32(0, 100, 255, 255); //default (214, 214, 214, 255);  //red (255, 0, 0, 255); //Blue (0, 100, 255, 255); //niceblue (0, 255, 230, 255); //Green (0, 255, 0, 255); //Yellow (0, 255, 255, 255); //Orange (0, 150, 255, 255); //Magenta (255, 0, 255, 255); //Pink (255, 0, 130, 255);
 *
 * USPG_API.grassHealthyColor0 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor0 = new Color32(111, 146, 91, 255); //default(111, 146, 91, 255);
 * USPG_API.grassHealthyColor1 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor1 = new Color32(111, 146, 91, 255); //default(111, 146, 91, 255);
 * USPG_API.grassHealthyColor2 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor2 = new Color32(111, 146, 91, 255); //default(111, 146, 91, 255);
 * USPG_API.grassHealthyColor3 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor3 = new Color32(111, 146, 91, 255); //default(111, 146, 91, 255);
 * USPG_API.grassHealthyColor4 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor4 = new Color32(111, 146, 91, 255); //default(111, 146, 91, 255);
 * USPG_API.grassHealthyColor5 = new Color32(150, 150, 150, 255); //default(150, 150, 150, 255);
 * USPG_API.grassDryColor5 = new Color32(111, 146, 91, 255);(111, 146, 91, 255);
 *
 * ///Grass settings Size//////
 * USPG_API.m_minWidth = 3f;
 * USPG_API.m_maxWidth = 4f;
 * USPG_API.m_minHeight = 0.5f;
 * USPG_API.m_maxHeight = 1f;
 *
 * // Grass Hole Raytracer settings//
 * USPG_API.Repiter = 60;
 * USPG_API.Resolution = 60f;
 * USPG_API.Height = 100000;
 * USPG_API.RAYTRASSA = 150;
 *
 */

/////////////////////////////////////////////////////////
    }