public override void OnGetValue(LocationInterceptionArgs args) { base.OnGetValue(args); if (DefaultProvider != null && !_defaultProviderSet) { _defaultProvider = (TypedValueProvider)Activator.CreateInstance(DefaultProvider); _defaultProviderSet = true; } if (Get) { if (ConvertType == null) { ConvertType = args.Location.LocationType; } try { args.Value = Json ? JsonConvert.DeserializeObject(FlashUtil.Call(Name), ConvertType) : FlashUtil.Call(Name, ConvertType); } catch { args.Value = _defaultProvider.Provide(ConvertType); } } }
public override void OnInvoke(MethodInterceptionArgs args) { if (RunMethodPre) { args.Proceed(); } if (DefaultProvider != null && !_defaultProviderSet) { _defaultProvider = (TypedValueProvider)Activator.CreateInstance(DefaultProvider); _defaultProviderSet = true; } if (GameFunction) { try { args.ReturnValue = JsonConvert.DeserializeObject(ScriptInterface.Instance.CallGameFunction(Name, args.Arguments.ToArray()), (args.Method as MethodInfo).ReturnType); } catch { args.ReturnValue = DefaultValue ?? _defaultProvider.Provide((args.Method as MethodInfo).ReturnType); } } else { args.ReturnValue = FlashUtil.Call(Name, (args.Method as MethodInfo).ReturnType, args.Arguments.ToArray()); } if (RunMethodPost && !RunMethodPre) { args.Proceed(); } }
public string Call() { string result = FlashUtil.Call("fcCall", _fobj.ID); if (DestroyOnCall) { Destroy(); } return(result); }
public FlashObject <T> CallFlash <T>() { FlashObject <T> obj = new FlashObject <T>(FlashUtil.Call <int>("fcCallFlash", _fobj.ID)); if (DestroyOnCall) { Destroy(); } return(obj); }
public override void OnSetValue(LocationInterceptionArgs args) { base.OnSetValue(args); if (Set) { foreach (string name in Names) { FlashUtil.Call("setGameObject", name, args.Value); } } }
public override void OnGetValue(LocationInterceptionArgs args) { if (DefaultProvider != null && !_defaultProviderSet) { _defaultProvider = (TypedValueProvider)Activator.CreateInstance(DefaultProvider); _defaultProviderSet = true; } if (Get) { if (RequireNotNull != null && ScriptInterface.Instance.IsNull(RequireNotNull)) { args.Value = DefaultValue ?? _defaultProvider.Provide(ConvertType); } else { try { if (ConvertType == null) { ConvertType = args.Location.LocationType; } if (Select != null) { args.Value = JsonConvert.DeserializeObject(FlashUtil.Call("selectArrayObjects", Names[GetIndex], Select), ConvertType); } else { args.Value = JsonConvert.DeserializeObject(FlashUtil.Call("getGameObject" + (Static ? "S" : ""), Names[GetIndex]), ConvertType); } } catch { args.Value = DefaultValue ?? _defaultProvider.Provide(ConvertType); } } } else { base.OnGetValue(args); } }
public override void OnSetValue(LocationInterceptionArgs args) { base.OnSetValue(args); if (Set) { try { if (UseValue) { FlashUtil.Call(Name, args.Value); } else { FlashUtil.Call(Name); } } catch { } } }
public override void OnSetValue(LocationInterceptionArgs args) { base.OnSetValue(args); FlashUtil.Call($"mod{((bool)args.Value ? "Enable" : "Disable")}", ModuleName); }
public void Set(int index, T value) { FlashUtil.Call("lnkSetArray", ID, index, value); }
public FlashObject <T> Get(int index) { return(new FlashObject <T>(FlashUtil.Call <int>("lnkGetArray", ID, index))); }
public FlashCaller ClearArgs() { FlashUtil.Call("fcClear", _fobj.ID); return(this); }
public FlashCaller PushArgs(params object[] objects) { FlashUtil.Call("fcPushDirect", new object[] { _fobj.ID }.Concat(objects).ToArray()); return(this); }
public FlashCaller PushArgs(params IFlashObject[] objects) { FlashUtil.Call("fcPush", _fobj.ID, objects.Select(x => x.ID).ToArray()); return(this); }