61 lines
1.6 KiB
C#
61 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using BehaviorDesigner.Runtime.Tasks.Unity.UnityGameObject;
|
|
using Gameplay;
|
|
using PhxhSDK;
|
|
using SRF;
|
|
using UnityEditor;
|
|
using UnityEditor.SceneManagement;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class ObjectPostProcessorManager : Singlenton<ObjectPostProcessorManager>
|
|
{
|
|
private ScenePostProcessor _scenePostProcessor;
|
|
|
|
private PrefabPostProcessor _prefabPostProcessor;
|
|
|
|
private ScenePostProcessor scenePostProcessor
|
|
{
|
|
get
|
|
{
|
|
_scenePostProcessor = _scenePostProcessor ?? new();
|
|
return _scenePostProcessor;
|
|
}
|
|
}
|
|
|
|
private PrefabPostProcessor prefabPostProcessor
|
|
{
|
|
get
|
|
{
|
|
_prefabPostProcessor = _prefabPostProcessor ?? new();
|
|
return _prefabPostProcessor;
|
|
}
|
|
}
|
|
|
|
public void PostProcess(Scene scene, bool destroyAfterPostProcess = false)
|
|
{
|
|
var instructor = PostProcessor.FindInstructorInScene(scene);
|
|
if (instructor == null)
|
|
{
|
|
Debug.LogError($"cant find PostProcessInstructor in scene,scene name:{scene}");
|
|
return;
|
|
}
|
|
|
|
PostProcess(instructor, destroyAfterPostProcess);
|
|
}
|
|
|
|
public void PostProcess(PostProcessInstructor instructor, bool destroyAfterPostProcess = false)
|
|
{
|
|
if (instructor.processPrefab)
|
|
{
|
|
prefabPostProcessor.PostProcess(instructor, destroyAfterPostProcess);
|
|
}
|
|
else
|
|
{
|
|
scenePostProcessor.PostProcess(instructor, destroyAfterPostProcess);
|
|
}
|
|
}
|
|
} |