Esempio n. 1
0
        public static float test_struct_constructor_default()
        {
            var localVar = new CustomStruct2();

            localVar.value = 1;
            return(localVar.value);
        }
Esempio n. 2
0
        public static float test_struct_func_call_instance()
        {
            var localVar = new CustomStruct2 {
                value = 123
            };

            return(localVar.returnDoubleValue());
        }
Esempio n. 3
0
        public static float test_struct_copysemantic()
        {
            var a = new CustomStruct2 {
                value = 123.0f
            };
            var b = a;

            b.value = 345;
            return(b.value);
        }
Esempio n. 4
0
 public override TypeCastResult TypeCastOnRead(object v, Type toType, bool fromUI, JsonReader.DocReadOptions options)
 {
     if (v is JsonDataMap map)
     {
         var result = new CustomStruct2 {
             Mission = map["n"].AsString(), When = map["y"].AsInt()
         };
         return(new TypeCastResult(TypeCastOutcome.HandledCast, result, typeof(CustomStruct2)));
     }
     return(TypeCastResult.NothingChanged);
 }
Esempio n. 5
0
        public static float test_struct_constructor_nondefault()
        {
            var localVar = new CustomStruct2(123.0f);

            return(localVar.value);
        }