Beispiel #1
0
        /// <summary>
        /// Sets the vectors active and updates thier position and directions
        /// </summary>
        private void UpdateVectors()
        {
            if (selectedInstance == null)
            {
                return;
            }

            cameraDistance = Vector3.Distance(selectedInstance.position, FlightCamera.fetch.transform.position) / 4;

            if (referenceSystem == Space.World)
            {
                fwdVR.SetShow(true);
                upVR.SetShow(true);
                rightVR.SetShow(true);

                fwdVR.Vector = selectedInstance.groupCenter.gameObject.transform.forward;
                fwdVR.Start  = vectorDrawPosition;
                fwdVR.Scale  = cameraDistance;
                fwdVR.Draw();

                upVR.Vector = selectedInstance.groupCenter.gameObject.transform.up;
                upVR.Start  = vectorDrawPosition;
                upVR.Scale  = cameraDistance;
                upVR.Draw();

                rightVR.Vector = selectedInstance.groupCenter.gameObject.transform.right;
                rightVR.Start  = vectorDrawPosition;
                rightVR.Scale  = cameraDistance;
                rightVR.Draw();
            }
            else
            {
                fwdVR.SetShow(true);
                upVR.SetShow(true);
                rightVR.SetShow(true);

                fwdVR.Vector = selectedInstance.transform.forward;
                fwdVR.Start  = vectorDrawPosition;
                fwdVR.Scale  = cameraDistance;
                fwdVR.Draw();

                upVR.Vector = selectedInstance.transform.up;
                upVR.Start  = vectorDrawPosition;
                upVR.Scale  = cameraDistance;
                upVR.Draw();

                rightVR.Vector = selectedInstance.transform.right;
                rightVR.Start  = vectorDrawPosition;
                rightVR.Scale  = cameraDistance;
                rightVR.Draw();
            }
        }