コード例 #1
0
        private void AddPrefabs(RaycastHit hit)
        {
            if (!editor.IsEditorSettingsValid())
            {
                return;
            }

            switch (gizmo.brushSettings.distribution)
            {
            case BrushSettings.Distribution.Center:
                AddPrefabs_Center(hit.point, hit.normal);
                break;

            case BrushSettings.Distribution.Poisson:
                AddPrefabs_Poisson(hit.point, hit.normal);
                break;

            case BrushSettings.Distribution.FallOff:
                Debug.Log("Not implemented yet: " + gizmo.brushSettings.distribution);
                break;

            case BrushSettings.Distribution.FallOff2d:
                Debug.Log("Not implemented yet: " + gizmo.brushSettings.distribution);
                break;
            }
        }
コード例 #2
0
        private void PerformEditorAction()
        {
            if (!editor.IsEditorSettingsValid())
            {
                return;
            }

            if (!editorTarget.splineSettings.dirty)
            {
                return;
            }

            if (editorTarget.splineSettings.spawnMechanism == SpawnMechanism.Manual)
            {
                return;
            }

            editorTarget.splineModule.PlaceObjects();

            editorTarget.splineSettings.dirty = false;

            // Set the editor spline dirty, so that the changed settings (e.g.control points got dragged in the scene) get updated.
            // Ensure the control points get saved when they are changed in the scene if we wouldn't do that, they'd only be change when something changes in the inspector
            EditorUtility.SetDirty(editor.target);
        }
コード例 #3
0
        private void PerformEditorAction()
        {
            if (!editor.IsEditorSettingsValid())
            {
                return;
            }

            if (!gizmo.splineSettings.dirty)
            {
                return;
            }

            gizmo.splineModule.PlaceObjects();


            gizmo.splineSettings.dirty = false;
        }