public void FindModel()
        {
            switch (ContextMode)
            {
            case BindingContextMode.MonoBinding:
                Context      = null;
                DataInstance = ViewModel;
                break;

            case BindingContextMode.MockBinding:
                Context = null;
                if (DataType == null)
                {
                    DataType = GetDataType();
                }
                break;

            case BindingContextMode.PropBinding:
                Context = BindingExtensions.FindInParent <BindingContext>(transform.parent.gameObject);
                if (!Application.isPlaying)
                {
                    SetPropertyTypeData();
                }
                break;

            case BindingContextMode.None:
                ClearTypeData();
                DataInstance = null;
                break;
            }
        }
Esempio n. 2
0
        public void FindContext()
        {
            Context = BindingProxy == null
                ? BindingExtensions.FindInParent <BindingContext>(gameObject)
                : BindingExtensions.FindInParent <BindingContext>(BindingProxy);

            if (BindingProxy != null && Context == null)
            {
                Debug.LogError("Invalid BindingProxy. Please bind to a BindingContext or its child.");
            }
        }