UnityEngine.Object.FindSceneObjectsOfType C# (CSharp) Method

FindSceneObjectsOfType() public static method

public static FindSceneObjectsOfType ( Type type ) : Object[]
type Type
return Object[]
		public static Object[] FindSceneObjectsOfType(Type type){}
		public static Object[] FindObjectsOfTypeIncludingAssets(Type type){}

Usage Example

コード例 #1
0
        public void Crawl <ComponentTypeToCrawl>(CrawlParameters <ComponentTypeToCrawl> crawlParameters)
            where ComponentTypeToCrawl : Component
        {
            EditorSceneManager.sceneLoaded += delegate(Scene scene, LoadSceneMode mode)
            {
                ComponentTypeToCrawl[] components =
                    Object.FindSceneObjectsOfType(crawlParameters.ComponentType) as ComponentTypeToCrawl[];

                CrawlResult <ComponentTypeToCrawl> result =
                    new CrawlResult <ComponentTypeToCrawl>(components);

                if (crawlParameters.OnCrawlingEnd != null)
                {
                    crawlParameters.OnCrawlingEnd(result);
                }
            };

            foreach (string sceneName in crawlParameters.SceneList)
            {
                if (!EditorSceneManager.GetActiveScene().name.Equals(sceneName))
                {
                    EditorSceneManager.LoadScene(sceneName);
                }
            }
        }
All Usage Examples Of UnityEngine.Object::FindSceneObjectsOfType