コード例 #1
0
        protected bool HandleAnchor(ref Vector3 position, bool isConnectedAnchor)
        {
            if (Joint2DEditor.s_Styles == null)
            {
                Joint2DEditor.s_Styles = new Joint2DEditor.Styles();
            }
            Handles.CapFunction arg_5A_0;
            if (isConnectedAnchor)
            {
                if (Joint2DEditor.< > f__mg$cache0 == null)
                {
                    Joint2DEditor.< > f__mg$cache0 = new Handles.CapFunction(Joint2DEditor.ConnectedAnchorHandleCap);
                }
                arg_5A_0 = Joint2DEditor.< > f__mg$cache0;
            }
            else
            {
                if (Joint2DEditor.< > f__mg$cache1 == null)
                {
                    Joint2DEditor.< > f__mg$cache1 = new Handles.CapFunction(Joint2DEditor.AnchorHandleCap);
                }
                arg_5A_0 = Joint2DEditor.< > f__mg$cache1;
            }
            Handles.CapFunction capFunction = arg_5A_0;
            int id = base.target.GetInstanceID() + ((!isConnectedAnchor) ? 0 : 1);

            EditorGUI.BeginChangeCheck();
            position = Handles.Slider2D(id, position, Vector3.back, Vector3.right, Vector3.up, 0f, capFunction, Vector2.zero);
            return(EditorGUI.EndChangeCheck());
        }
コード例 #2
0
 protected bool HandleAnchor(ref Vector3 position, bool isConnectedAnchor)
 {
   if (Joint2DEditor.s_Styles == null)
     Joint2DEditor.s_Styles = new Joint2DEditor.Styles();
   Handles.DrawCapFunction drawFunc = !isConnectedAnchor ? new Handles.DrawCapFunction(Joint2DEditor.AnchorCap) : new Handles.DrawCapFunction(Joint2DEditor.ConnectedAnchorCap);
   int id = this.target.GetInstanceID() + (!isConnectedAnchor ? 0 : 1);
   EditorGUI.BeginChangeCheck();
   position = Handles.Slider2D(id, position, Vector3.back, Vector3.right, Vector3.up, 0.0f, drawFunc, Vector2.zero);
   return EditorGUI.EndChangeCheck();
 }
コード例 #3
0
ファイル: Joint2DEditor.cs プロジェクト: wensincai/Unity5.4
        protected bool HandleAnchor(ref Vector3 position, bool isConnectedAnchor)
        {
            if (Joint2DEditor.s_Styles == null)
            {
                Joint2DEditor.s_Styles = new Joint2DEditor.Styles();
            }
            Handles.DrawCapFunction drawFunc = (!isConnectedAnchor) ? new Handles.DrawCapFunction(Joint2DEditor.AnchorCap) : new Handles.DrawCapFunction(Joint2DEditor.ConnectedAnchorCap);
            int id = this.target.GetInstanceID() + ((!isConnectedAnchor) ? 0 : 1);

            EditorGUI.BeginChangeCheck();
            position = Handles.Slider2D(id, position, Vector3.back, Vector3.right, Vector3.up, 0f, drawFunc, Vector2.zero);
            return(EditorGUI.EndChangeCheck());
        }