public override void Awake(ActorManagerComponent self) { ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>(); resourcesComponent.LoadBundle("Cube".StringToAB().BundleNameToLower()); GameObject prefab = resourcesComponent.GetAsset("Cube".StringToAB().BundleNameToLower(), "Cube") as GameObject; GameObject cube = GameObject.Instantiate(prefab); resourcesComponent.UnLoadBundle("Cube".StringToAB().BundleNameToLower()); Actor actor = ComponentFactory.Create <Actor, GameObject>(cube); self.Add(actor); }
public override void Awake(UIComponent self) { self.Camera = Component.Global.transform.Find("UICamera").gameObject; ResourcesComponent resourcesComponent = Game.Scene.GetComponent <ResourcesComponent>(); resourcesComponent.LoadBundle("Config".StringToAB().BundleNameToLower()); GameObject config = resourcesComponent.GetAsset("Config".StringToAB().BundleNameToLower(), "Config") as GameObject; if (config != null) { Debug.Log(config.Get <TextAsset>("123").text); } resourcesComponent.UnLoadBundle("Config".StringToAB().BundleNameToLower()); }