protected void Awake() { // Constraint componant not required by this class because of the use of the // base class. So, instead, test for null and notify the user if not found. if (this.unityConstraint == null) { this.unityConstraint = this.GetComponent <ConstraintBaseClass>(); if (this.unityConstraint == null) { throw new MissingComponentException ( string.Format("No UnityConstraint was found on GameObject '{0}'", this.name) ); } } // Trigger property logic if a FireController is found or on this GameObject if (this._targetSource == null) { EventFireController ctrl = this.GetComponent <EventFireController>(); if (ctrl != null) { this.targetSource = ctrl; } } else { this.targetSource = this._targetSource; } }
protected void Awake() { // Constraint componant not required by this class because of the use of the // base class. So, instead, test for null and notify the user if not found. if (this.unityConstraint == null) { this.unityConstraint = this.GetComponent<ConstraintBaseClass>(); if (this.unityConstraint == null) throw new MissingComponentException ( string.Format("No UnityConstraint was found on GameObject '{0}'", this.name) ); } // Trigger property logic if a FireController is found or on this GameObject if (this._targetSource == null) { EventFireController ctrl = this.GetComponent<EventFireController>(); if (ctrl != null) this.targetSource = ctrl; } else { this.targetSource = this._targetSource; } }