25 lines
853 B
C#
25 lines
853 B
C#
|
|
using UnityEngine;
|
|
|
|
// 创建菜单项,方便在项目中创建该资产
|
|
[CreateAssetMenu(fileName = "GroundToolConfig", menuName = "GroundTools/Ground Tool Configuration")]
|
|
public class GroundToolConfig : ScriptableObject
|
|
{
|
|
// 将所有需要保存的参数定义为public字段或[SerializeField]的私有字段
|
|
public float randOffset = 0f;
|
|
public float randJitter = 0.1f;// 随机扰动
|
|
public int width = 128;
|
|
public int length = 128;
|
|
public float height = 30f;
|
|
public float perlinScale = 0.05f;
|
|
public float groundIncline = 0.01f;
|
|
public float matSplit1 = 0.25f;
|
|
public float matSplit2 = 0.5f;
|
|
public float matSplit3 = 0.75f;
|
|
public float power = 2f;
|
|
// 纹理(Texture)是Unity引擎对象的引用,本身可以被序列化
|
|
public Texture texGround1;
|
|
public Texture texGround2;
|
|
public Texture texGround3;
|
|
public Texture texGround4;
|
|
} |