Exemplo n.º 1
0
        public async Task <Widget> CreateInstance(IUIStack manager, string name, UIMessage message)
        {
            var loader = Her.Resolve <IViewLoader>();
            var prefab = await loader.LoadView(name);

            if (prefab == null)
            {
                throw new Exception($"Load view: {name} failed");
            }

            var instance = Object.Instantiate(prefab).GetComponent <Widget>();

            instance.SetManagerInfo(name, manager, message);
            return(instance);
        }
Exemplo n.º 2
0
 private void Start()
 {
     _viewManager = Her.Resolve <IViewManager>();
 }
Exemplo n.º 3
0
 public virtual void CleanUpViewInfo()
 {
     Her.Resolve <IViewManager>().UnRegister(ViewId);
 }
Exemplo n.º 4
0
 public virtual void SetUpViewInfo()
 {
     ViewId = Her.Resolve <IViewManager>().Register(this);
 }