internal override bool InitializeTarget(Trackable trackable, bool applyTargetScaleToBehaviour) { base.InitializeTarget(trackable, applyTargetScaleToBehaviour); ObjectTargetImpl objectTargetImpl = trackable as ObjectTargetImpl; if (objectTargetImpl == null) { return(false); } this.mTrackable = (this.mObjectTarget = objectTargetImpl); this.mTrackableName = objectTargetImpl.Name; this.mDataSetPath = objectTargetImpl.DataSet.Path; Vector3 size = objectTargetImpl.GetSize(); this.mAspectRatioXY = size.y / size.x; this.mAspectRatioXZ = size.z / size.x; if (applyTargetScaleToBehaviour) { float num = Mathf.Max(new float[] { size.x, size.y, size.z }); base.transform.localScale = new Vector3(num, num, num); base.CorrectScale(); } Vector3 size2 = this.GetSize(); objectTargetImpl.SetSize(size2); if (this.mExtendedTracking) { this.mObjectTarget.StartExtendedTracking(); } return(true); }
protected override void InternalUnregisterTrackable() { this.mTrackable = (this.mObjectTarget = null); }