Exemple #1
0
 public void AimAt(Transform target)
 {
     this.transform.LookAt(target.position, this.transform.up);
     if (this.rotationLimit == null)
     {
         this.rotationLimit = this.transform.GetComponent <RotationLimit>();
         this.rotationLimit.Disable();
     }
     this.rotationLimit.Apply();
 }
Exemple #2
0
            private RotationLimit rotationLimit; // The Rotation Limit component

            #endregion Fields

            #region Methods

            // Aim this part at the target
            public void AimAt(Transform target)
            {
                transform.LookAt(target.position, transform.up);

                // Finding the Rotation Limit
                if (rotationLimit == null) {
                    rotationLimit = transform.GetComponent<RotationLimit>();
                    rotationLimit.Disable();
                }

                // Apply rotation limits
                rotationLimit.Apply();
            }
Exemple #3
0
            private RotationLimit rotationLimit;    // The Rotation Limit component

            // Aim this part at the target
            public void AimAt(Transform target)
            {
                transform.LookAt(target.position, transform.up);

                // Finding the Rotation Limit
                if (rotationLimit == null)
                {
                    rotationLimit = transform.GetComponent <RotationLimit>();
                    rotationLimit.Disable();
                }

                // Apply rotation limits
                rotationLimit.Apply();
            }