예제 #1
0
 private RefCommand(RefMode refMode)
 {
     _refMode = refMode;
 }
예제 #2
0
 public RefCommand(RefMode refMode)
 {
     _refMode = refMode;
 }
예제 #3
0
 public RefCommand(RefMode refMode)
 {
     _refMode = refMode;
 }
예제 #4
0
 public static string Ref(RefMode refMode)
 {
     return(string.Format("AT*REF=[SEQUENCE],{0}\r", (int)refMode));
 }
예제 #5
0
 private RefCommand(RefMode refMode)
 {
     _refMode = refMode;
 }
        public void SetToProperty(UnityEngine.Object obj, string property)
        {
            if (obj == null) throw new System.ArgumentNullException("obj");
            var member = DynamicUtil.GetMember(obj, property, false);
            if(member == null)
            {
                _type = VariantType.Null;
            }
            else
            {
                var tp = DynamicUtil.GetReturnType(member);
                if (tp != null)
                    _type = VariantReference.GetVariantType(tp);
                else
                    _type = VariantType.Null;
            }

            _mode = RefMode.Property;
            _x = 0f;
            _y = 0f;
            _z = 0f;
            _w = 0d;

            _string = property;
            _unityObjectReference = obj;
        }
예제 #7
0
 /// <summary>
 /// Configures the reference voltage used for analog input (i.e. the value used as the top of the input range).
 /// </summary>
 /// <param name="type">which type of reference to use</param>
 public void Reference(RefMode type)
 {
     analogReference(type);
 }
 public void PrepareForRefModeChange(RefMode mode)
 {
     _variant._mode = mode;
     _variant._x = 0f;
     _variant._y = 0f;
     _variant._z = 0f;
     _variant._w = 0d;
     _variant._string = string.Empty;
     switch(mode)
     {
         case RefMode.Value:
             //_variant._type = ...;
             _variant._unityObjectReference = null;
             break;
         case RefMode.Property:
             _variant._type = VariantType.Null;
             break;
         case RefMode.Eval:
             _variant._type = VariantType.Double;
             break;
     }
 }
 void System.IDisposable.Dispose()
 {
     _mode = RefMode.Value;
     _type = VariantType.Null;
     _x = 0f;
     _y = 0f;
     _z = 0f;
     _w = 0.0;
     _string = null;
     _unityObjectReference = null;
 }
 private VariantReference(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     var mode = (RefMode)info.GetByte("mode");
     switch(mode)
     {
         case RefMode.Value:
             _mode = RefMode.Value;
             _type = (VariantType)info.GetInt32("type");
             switch (_type)
             {
                 case VariantType.Object:
                 case VariantType.Null:
                     this.Value = null;
                     break;
                 case VariantType.String:
                     this.StringValue = info.GetString("value");
                     break;
                 case VariantType.Boolean:
                     this.BoolValue = info.GetBoolean("value");
                     break;
                 case VariantType.Integer:
                     this.IntValue = info.GetInt32("value");
                     break;
                 case VariantType.Float:
                     this.FloatValue = info.GetSingle("value");
                     break;
                 case VariantType.Double:
                     this.DoubleValue = info.GetDouble("value");
                     break;
                 case VariantType.Vector2:
                 case VariantType.Vector3:
                 case VariantType.Quaternion:
                 case VariantType.Color:
                     var arr = StringUtil.SplitFixedLength(info.GetString("value"), ",", 4);
                     _x = ConvertUtil.ToSingle(arr[0]);
                     _y = ConvertUtil.ToSingle(arr[1]);
                     _z = ConvertUtil.ToSingle(arr[2]);
                     _w = ConvertUtil.ToDouble(arr[3]);
                     break;
                 case VariantType.DateTime:
                     this.DateValue = info.GetDateTime("value");
                     break;
                 case VariantType.GameObject:
                 case VariantType.Component:
                     this.Value = null;
                     break;
             }
             break;
         case RefMode.Property:
             this.Value = null; //just set to null value
             break;
     }
 }
        public void SetToEvalStatement(string statement, UnityEngine.Object optionalParam = null)
        {
            _mode = RefMode.Eval;
            _x = 0f;
            _y = 0f;
            _z = 0f;
            _w = 0d;

            _string = statement;
            _unityObjectReference = optionalParam;
        }
예제 #12
0
 public static void analogReference(RefMode _type)
 {
 }