Beispiel #1
0
 /// <summary>
 /// Append all Transform found in this scene into _gameObjectsList list
 /// </summary>
 /// <param name="scene"></param>
 public void AppendAllTransformInSceneToList(Scene scene)
 {
     if (!scene.IsValid())
     {
         return;
     }
     GameObject[] roots = scene.GetRootGameObjects();
     for (int i = 0; i < roots.Length; i++)
     {
         Transform[] allChilds = roots[i].GetComponentsInChildren <Transform>(true);
         ExtList.Append <Transform>(_gameObjectsList, allChilds.ToList());
     }
 }
        private static ContextListerAsset GenerateContextReferencer()
        {
            ContextListerAsset globalContextLister = ExtScriptableObject.CreateAsset <ContextListerAsset>("Assets/Context Lister.asset");
            SceneContextAsset  context             = ExtScriptableObject.CreateAsset <SceneContextAsset>("Assets/Context 1.asset");

            context.NameContext = "Demo Scene List";
            SceneReference[] sceneItems = SceneReference.GetAllActiveScene();
            ExtList.Append(context.SceneToLoad, sceneItems.ToList());
            globalContextLister.AddContext(context);

            globalContextLister.Save();
            context.Save();
            AssetDatabase.Refresh();

            return(globalContextLister);
        }