Author Topic: NGUITransformInspector.cs 3 possible bugs?  (Read 1202 times)

dcparker

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
NGUITransformInspector.cs 3 possible bugs?
« on: March 14, 2014, 03:07:52 PM »
In the file NGUITransformInspector.cs, I found the code using Bitwise operation on enum without flags.  Would you want to change the Axes enum to the following?

  1.     [Flags]
  2.     enum Axes : int
  3.         {
  4.                 None = 0,
  5.                 X = 1,
  6.                 Y = 2,
  7.                 Z = 4,
  8.                 All = 7,
  9.         }
  10.  


On line 150, did you the following name space should be added?

  1. using System;
  2. using UnityEngine;
  3. using UnityEditor;
  4. using Object = UnityEngine.Object;
  5.  


Do you think the missing xml tags should be added like below?


  1.     /// <summary>
  2.     /// Draw an editable float field.
  3.     /// </summary>
  4.     /// <param name="value"> </param>
  5.     /// <param name="hidden">Whether to replace the value with a dash</param>
  6.     /// <param name="greyedOut">Whether the value should be greyed out or not</param>
  7.     /// <param name="name"> </param>
  8.     /// <param name="opt"> </param>
  9.     static bool FloatField (string name, ref float value, bool hidden, bool greyedOut, GUILayoutOption opt)
  10.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUITransformInspector.cs 3 possible bugs?
« Reply #1 on: March 14, 2014, 03:40:56 PM »
[Flags] does nothing. The enum is already an integer with specific values. [Flags] makes it easy to do certain things like convert to a string.

I see no reason to clarify Object usage. This class doesn't use the System namespace.

I don't particularly care much about documenting parameters. Function description is enough.