Пример #1
0
        private void Awake()
        {
            //Set this script as the only instance of the SelectionHandle script
            if (Instance == null)
            {
                Instance = this;
            }

            //Hide the handle by default
            hidden          = true;
            parentTransform = gameObject.GetComponent <Transform>();
            mainCamera      = Camera.main;

            //Instantiate the adjustable speed classes
            translationSpeed = new AdjustableSpeed(defaultTranslationSpeed, speedMultiplier, true, false);
            rotationSpeed    = new AdjustableSpeed(defaultRotationSpeed, speedMultiplier, true, false);
            scaleSpeed       = new AdjustableSpeed(defaultScaleSpeed, speedMultiplier, true, false);

            //The selection handle is in translate mode by default
            Tool = Tool.Translate;

            //Create the meshes needed for the tool handle
            handleLineMesh = new Mesh();
            CreateHandleLineMesh(ref handleLineMesh, Vector3.one);
            handleTriangleMesh = new Mesh();
            CreateHandleTriangleMesh(ref handleTriangleMesh, Vector3.one);
            //Set the default size of the handle mesh
            scale = Vector3.one;
        }
Пример #2
0
        //Instantiate the adjustable speed class
        private void Awake()
        {
            //Set this script as the only instance of the SelectionHandle script
            if (Instance == null)
            {
                Instance = this;
            }

            movementSpeed = new AdjustableSpeed(defaultMovementSpeed, speedMultiplier);
        }