Ejemplo n.º 1
0
 /// <summary>
 /// 取消绑定物体,本函数中自动获取gameObject的DataModelBehaviour对象,
 /// 如果不能获取,则抛出异常;
 /// </summary>
 /// <param name="goObserver"></param>
 /// <param name="goSubject"></param>
 public void Unbinding(DataModelBehaviour observer, DataModelBehaviour subject)
 {
     if (observer != null && subject != null)
     {
         observer.Unwatch(subject);
     }
     else
     {
         throw new BindingException("observer or subject could not be found.");
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 取消绑定物体,本函数中自动获取gameObject的DataModelBehaviour对象,
 /// 如果不能获取,则抛出异常;
 /// </summary>
 /// <param name="goObserver"></param>
 /// <param name="goSubject"></param>
 public void Unbinding(DataModelBehaviour observer, BaseDataModelEntity subject, string propertyPath)
 {
     if (observer != null && subject != null)
     {
         observer.Unwatch(subject, propertyPath);
     }
     else
     {
         throw new BindingException("observer or subject could not be found.");
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 取消绑定物体,本函数中自动获取gameObject的DataModelBehaviour对象,
        /// 如果不能获取,则抛出异常;
        /// </summary>
        /// <param name="goObserver"></param>
        /// <param name="goSubject"></param>
        public void Unbinding(GameObject goObserver, GameObject goSubject)
        {
            DataModelBehaviour observer = null;
            DataModelBehaviour subject  = null;

            observer = goObserver.GetComponent <DataModelBehaviour>();
            subject  = goSubject.GetComponent <DataModelBehaviour>();

            if (observer != null && subject != null)
            {
                observer.Unwatch(subject);
            }
            else
            {
                throw new BindingException("observer or subject could not be found.");
            }
        }