コード例 #1
0
        public bool BeginCapture(Ray ray, UIRayHit hit)
        {
            activeWidget = null;

            // if the hit gameobject has a widget attached to it, begin capture & transformation
            // TODO maybe wrapper class should have Begin/Update/End capture functions, then we do not need BeginTransformation/EndTransformation ?
            if (Widgets.ContainsKey(hit.hitGO))
            {
                Widget w = Widgets [hit.hitGO];
                if (w.BeginCapture(targetWrapper, ray, hit))
                {
                    targetWrapper.BeginTransformation();
                    activeWidget = w;
                    return(true);
                }
            }
            return(false);
        }
コード例 #2
0
        virtual public bool BeginCapture(InputEvent e)
        {
            activeWidget = null;

            // if the hit gameobject has a widget attached to it, begin capture & transformation
            // TODO maybe wrapper class should have Begin/Update/End capture functions, then we do not need BeginTransformation/EndTransformation ?
            if (Widgets.ContainsKey(e.hit.hitGO))
            {
                Standard3DTransformWidget w = Widgets [e.hit.hitGO];
                if (w.BeginCapture(targetWrapper, e.ray, e.hit.toUIHit()))
                {
                    MaterialUtil.SetMaterial(w.RootGameObject, w.HoverMaterial);
                    targetWrapper.BeginTransformation();
                    activeWidget = w;
                    OnTransformInteractionStart();
                    return(true);
                }
            }
            return(false);
        }