示例#1
0
 /// <summary>
 ///
 /// Main constructor
 ///
 /// </summary>
 /// <param name="type">type of component</param>
 /// <param name="sizedata">size of the component</param>
 /// <param name="x">x position of the component</param>
 /// <param name="z">z position of the component</param>
 /// <param name="obj">Unity game object that represents the joint</param>
 /// <param name="textLabel">Unity Game object that represents the text label above the joint</param>
 public JointInfo(UAVComponentType type, int sizedata,
                  float x, float z,
                  GameObject obj, GameObject textLabel)
 {
     componentType  = type;
     this.sizedata  = sizedata;
     this.x         = x;
     this.z         = z;
     this.gameObj   = obj;
     this.textLabel = textLabel;
     this.index     = counter;
     setTextLabel();
     counter++;
 }
示例#2
0
 /// <summary>
 /// gets the next component type
 /// </summary>
 /// <param name="comptype">current component type</param>
 /// <returns>next component type</returns>
 public static UAVComponentType getNextComponentType(UAVComponentType comptype)
 {
     if (comptype.Equals(UAVComponentType.None))
     {
         return(UAVComponentType.Structure);
     }
     else if (comptype.Equals(UAVComponentType.Structure))
     {
         return(UAVComponentType.MotorCW);
     }
     else if (comptype.Equals(UAVComponentType.MotorCW))
     {
         return(UAVComponentType.MotorCCW);
     }
     else if (comptype.Equals(UAVComponentType.MotorCCW))
     {
         return(UAVComponentType.Foil);
     }
     else
     {
         return(UAVComponentType.None);
     }
 }