public void Add(PreloadElement element)
 {
     if (preload == null)
     {
         preload = new List <PreloadElement>();
     }
     preload.Add(element);
 }
예제 #2
0
        public static async Task <List <GameObject> > LoadPreElement(SceneElementAsset sceneElements)
        {
            List <GameObject> list = new List <GameObject>();

            //三.加载地形
            if (sceneElements.preload != null)
            {
                for (int i = 0; i < sceneElements.preload.Count; i++)
                {
                    PreloadElement element = sceneElements.preload[i];
                    GameObject     @object = await LoadSceneElement(element.ResId);

                    @object.transform.parent      = m_Env.transform;
                    @object.transform.position    = element.position;
                    @object.transform.eulerAngles = element.rotation;
                    @object.transform.localScale  = element.scale;
                    list.Add(@object);
                }
            }

            return(list);
        }