void AddToModelView() { if (model is ValueType) { return; } ModelViewBehaviour mv = null;// = GetComponentInParent<ModelViewBehaviour>(); var parent = transform; while (parent != null) { mv = parent.GetComponent <ModelViewBehaviour>(); if (mv != null) { break; } parent = parent.parent; } if (mv != null) { mv.AddModelView(this.model, this); } }
void Awake() { mvb = GetComponent <ModelViewBehaviour>(); theme = GetComponent <ThemeListener>(); targetView = new TargetView(GetComponent <Canvas>()); }