测试工具代码。

using UnityEngine;
using UnityEditor;
using GLight;
public class TestFunctionButton : EditorWindow
{
    private float float_value;
    private int int_value;
    void OnGUI()
    {
        // 在这里绘制GUI界面
        GUILayout.Label("Test Function Function", EditorStyles.boldLabel);

        int_value = EditorGUILayout.IntSlider("Scatter Count", int_value, 0, 10);
        float_value = EditorGUILayout.Slider("Seed",float_value, 0, 100000);
        

        if (GUILayout.Button("Test Function"))
        {
            Scatter scatter = new Scatter();
            scatter.Execute(Selection.activeGameObject, int_value, Mathf.FloorToInt(float_value));
            for (int i = 0; i < scatter.points.Count; i++)
            {
                InstancePoint instancePoint = new InstancePoint(scatter.points[i].position, scatter.points[i].orient, new Vector3(1,1,1));
                instancePoint.guid = AssetDatabase.AssetPathToGUID("Assets/Art/Darth_Artisan/Free_Trees/Prefabs/Poplar_Tree.prefab");	//树的资产

                GameObject GO = (GameObject)PrefabUtility.InstantiatePrefab((Object)AssetDatabase.LoadAssetAtPath<GameObject>(AssetDatabase.GUIDToAssetPath(instancePoint.guid)));
                GO.transform.localPosition = instancePoint.position;
                GO.transform.localRotation = instancePoint.orient;
                GO.transform.localScale = instancePoint.scale;
            }
        }
    }

    [MenuItem("GLight Tools/Test Function Function")]
    static void Init()
    {
        TestFunctionButton window = (TestFunctionButton)GetWindow(typeof(TestFunctionButton));
        window.Show();
    }
}