リポジトリ
使用例
すべてのシーンに対して処理を行う
using Kogane;
using UnityEditor;
using UnityEngine;
public static class Example
{
[MenuItem( "Tools/Hoge" )]
private static void Hoge()
{
SceneProcessor.ProcessAllScenes
(
scene =>
{
GameObject.CreatePrimitive( PrimitiveType.Cube );
return SceneProcessResult.CHANGE;
}
);
}
}
特定のシーンに対して処理を行う
using Kogane;
using UnityEditor;
using UnityEngine;
public static class Example
{
[MenuItem( "Tools/Hoge" )]
private static void Hoge()
{
SceneProcessor.ProcessAllScenes
(
scenePathFilter: scenePath => scenePath.StartsWith( "Assets/@Project" ),
scene =>
{
GameObject.CreatePrimitive( PrimitiveType.Cube );
return SceneProcessResult.CHANGE;
}
);
}
}