Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created March 27, 2017 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/23f77c2d8f37d3f8f92ccd63a5408944 to your computer and use it in GitHub Desktop.
Save tsubaki/23f77c2d8f37d3f8f92ccd63a5408944 to your computer and use it in GitHub Desktop.
各シーンに処理を行う
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor.Build;
using UnityEditor.Callbacks;
using UnityEditor;
using UnityEngine.UI;
public class Processor : IProcessScene {
public void OnProcessScene (UnityEngine.SceneManagement.Scene scene)
{
foreach (var light in GameObject.FindObjectsOfType<Light>()) {
if( light.isBaked )
GameObject.DestroyImmediate (light.gameObject);
}
foreach (var obj in scene.GetRootGameObjects()) {
if (obj.GetComponent<Canvas> () == null)
obj.transform.DetachChildren ();
}
}
// 実行順
public int callbackOrder { get { return 0; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment