/// <summary> /// Adds the listener. /// </summary> protected virtual void AddListener() { if ((Line != null) && (Line.Target != null)) { listener = Utilites.GetOrAddComponent <TransformListener>(Line.Target); listener.OnTransformChanged.AddListener(SetVerticesDirty); } }
/// <summary> /// Adds the self listener. /// </summary> protected void AddSelfListener() { if (currentTransformListener == null) { currentTransformListener = GetComponent <TransformListener>(); } if (currentTransformListener != null) { currentTransformListener.OnTransformChanged.AddListener(SetVerticesDirty); } }
/// <summary> /// Adds the listener. /// </summary> protected virtual void AddListener() { if ((Line != null) && (Line.Target != null)) { listener = Line.Target.GetComponent <TransformListener>(); if (listener == null) { listener = Line.Target.gameObject.AddComponent <TransformListener>(); } listener.OnTransformChanged.AddListener(SetVerticesDirty); } }