예제 #1
0
        public void Set(Transform target, Vector3 pivot, ManipulationHandle.TransformSpaces space)
        {
            if (space == ManipulationHandle.TransformSpaces.Global)
            {
                xDirection = Vector3.right;
                yDirection = Vector3.up;
                zDirection = Vector3.forward;
            }
            else if (space == ManipulationHandle.TransformSpaces.Local)
            {
                xDirection = target.right;
                yDirection = target.up;
                zDirection = target.forward;
            }

            this.pivot = pivot;
        }
예제 #2
0
        public static bool TransformTypeContains(this ManipulationHandle.TransformTypes mainType, ManipulationHandle.TransformTypes type, ManipulationHandle.TransformSpaces space)
        {
            if (type == mainType)
            {
                return(true);
            }

            if (mainType == ManipulationHandle.TransformTypes.All)
            {
                if (type == ManipulationHandle.TransformTypes.Move)
                {
                    return(true);
                }

                if (type == ManipulationHandle.TransformTypes.Rotate)
                {
                    return(true);
                }
                //else if(type == TransformType.RectTool) return false;

                if (type == ManipulationHandle.TransformTypes.Scale && space == ManipulationHandle.TransformSpaces.Local)
                {
                    return(true);
                }
            }

            return(false);
        }