public override bool Trigger(object arg) { if (!this.CanTrigger) { return(false); } var observer = this._observer.GetTarget <Transform>(arg); if (observer == null) { return(false); } var targ = this._target.GetTarget <Transform>(arg); if (targ == null) { return(false); } var dir = targ.position - observer.position; var ax = (this._axisIsRelative) ? this.transform.GetAxis(this._axis) : TransformUtil.GetAxis(this._axis); if (this._flattenOnAxis) { dir = dir.SetLengthOnAxis(ax, 0f); } var q = Quaternion.LookRotation(dir, ax); if (this._slerp) { observer.rotation = QuaternionUtil.SpeedSlerp(observer.rotation, q, this._slerpAngularSpeed, Time.deltaTime); } else { observer.rotation = q; } return(true); }