コード例 #1
0
        public void InitEventWatcher()
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.EventPath);

            if (rBoundEvent != null)
            {
                this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, this.SyncFromView);
            }
            else
            {
                Debug.LogErrorFormat("Can not parse bound event: {0}.", this.EventPath);
            }
        }
コード例 #2
0
ファイル: EventBinding.cs プロジェクト: zhumingchuang/knight
        public void InitEventWatcher(Action <EventArg> rAction)
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.ViewEvent);

            if (rBoundEvent != null)
            {
                this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, rAction);
            }
            else
            {
                Debug.LogErrorFormat("Can not parse bound event: {0}.", this.ViewEvent);
            }
        }
コード例 #3
0
        public override void GetPaths()
        {
            base.GetPaths();

            var rViewModelProps = new List <BindableMember <PropertyInfo> >(
                DataBindingTypeResolve.GetListViewModelProperties(this.gameObject));

            this.ModelPaths = DataBindingTypeResolve.GetAllViewModelPaths(rViewModelProps).ToArray();

            if (string.IsNullOrEmpty(this.ViewModelPath))
            {
                this.ViewModelPath = this.ModelPaths.Length > 0 ? this.ModelPaths[0] : "";
            }
        }
コード例 #4
0
 public void GetPaths()
 {
     ViewModelClasses = DataBindingTypeResolve.GetAllViewModels().ToArray();
 }
コード例 #5
0
 public virtual void GetPaths()
 {
     this.TemplateViewModels = DataBindingTypeResolve.GetAllViewModels().ToArray();
 }
コード例 #6
0
 public void GetAllViewModelDataSources()
 {
     this.ViewModels       = new List <ViewModelDataSource>(this.GetComponentsInChildren <ViewModelDataSource>(true));
     this.EventBindings    = new List <EventBinding>(this.GetComponentsInChildren <EventBinding>(true));
     this.ViewModelClasses = DataBindingTypeResolve.GetAllViews().ToArray();
 }
コード例 #7
0
        public UnityEventWatcher(Component rComp, string rEventName, Action <EventArg> rAction)
        {
            var rBindableEvent = DataBindingTypeResolve.GetBoundEvent(rEventName, rComp);

            this.mUnityEventBinder = UnityEventBinderFactory.Create(rBindableEvent?.UnityEvent, rAction);
        }
コード例 #8
0
 public void GetAllViewModelDataSources()
 {
     ViewModels            = new List <ViewModelDataSource>(GetComponentsInChildren <ViewModelDataSource>(true));
     EventBindings         = new List <EventBinding>(GetComponentsInChildren <EventBinding>(true));
     ViewControllerClasses = DataBindingTypeResolve.GetAllViews().ToArray();
 }
コード例 #9
0
        public void InitEventWatcher()
        {
            var rBoundEvent = DataBindingTypeResolve.MakeViewDataBindingEvent(this.gameObject, this.EventPath);

            this.mUnityEventWatcher = new UnityEventWatcher(rBoundEvent.Component, rBoundEvent.Name, this.SyncFromView);
        }