private void Update() { if (!_initalized) { if (Note == null) { Destroy(this); } WriteNoteData(); _Tuner = LimTunerManager.Instance; _TunerObject = GameObject.Find("LimTunerManager/Tuner"); _NoteSortingID = SortingLayer.NameToID("Note"); //Check Update for MovePercent Delegate bool shouldUpdateDelegate = false; if (_HoldManager == null || _CalcMovePercent == null) { _HoldManager = _Tuner.HoldNoteManager; shouldUpdateDelegate = true; } else if (_HoldManager != _Tuner.HoldNoteManager) { _HoldManager = _Tuner.HoldNoteManager; shouldUpdateDelegate = true; } if (shouldUpdateDelegate) { var managerType = typeof(LimHoldNoteManager); var method = managerType.GetMethod("CalculateMovePercent", BINDING_PRIVATE); var newDelegate = Delegate.CreateDelegate(typeof(Func <float, float>), _HoldManager, method); _CalcMovePercent = (Func <float, float>)newDelegate; } var scrolls = _Tuner.ScrollManager.Scroll; _ScrollTimes = new NativeArray <float>(scrolls.Count, Allocator.Persistent); _ScrollSpeeds = new NativeArray <float>(scrolls.Count, Allocator.Persistent); for (int j = 0; j < scrolls.Count; j++) { _ScrollSpeeds[j] = scrolls[j].Speed; _ScrollTimes[j] = scrolls[j].Time; } _initalized = true; } CheckRendererCount(); UpdateRendererMeshValue(); UpdateRendererMesh(); }
public LuaCallback(LanotaliumContext context, Script script) { _Operation = context.OperationManager; _Tuner = context.TunerManager; _MessageBox = context.MessageBox; _Script = script; _Script.Globals["get_field_int"] = (Func <string, int>)GetRequestIntField; _Script.Globals["get_field_float"] = (Func <string, float>)GetRequestFloatField; _Script.Globals["get_field_bool"] = (Func <string, bool>)GetRequestBoolField; _Script.Globals["get_field_string"] = (Func <string, string>)GetRequestStringField; _Script.Globals["showmessage"] = (Action <string, string, string>)ShowMessage; _Script.Globals["showmsg"] = (Action <string, string, string>)ShowMessage; _Script.Globals["add_click"] = (Action <float, float>)CreateClickNote; _Script.Globals["add_catch"] = (Action <float, float>)CreateCatchNote; _Script.Globals["add_flickin"] = (Action <float, float>)CreateFlickInNote; _Script.Globals["add_flickout"] = (Action <float, float>)CreateFlickOutNote; _Script.Globals["add_linear"] = (Action <float, float, float, float, int>)CreateLinearMotion; _Script.Globals["add_circular"] = (Action <float, float, float, float, int>)CreateCircularMotion; _Script.Globals["add_vertical"] = (Action <float, float, float, int>)CreateVerticalMotion; _Script.Globals["add_rotation"] = (Action <float, float, float, int>)CreateRotationMotion; _Script.Globals["add_bpm"] = (Action <float, float>)CreateBPMChange; _Script.Globals["add_scroll"] = (Action <float, float>)CreateScrollChange; _Script.Globals["current_bpm"] = (Func <float>)GetCurrentBpm; _Script.Globals["current_scrollspeed"] = (Func <float>)GetCurrentScrollSpeed; _Script.Globals["current_speed"] = (Func <float>)GetCurrentScrollSpeed; _Script.Globals["current_x"] = (Func <float>)GetCurrentX; _Script.Globals["current_y"] = (Func <float>)GetCurrentZ; _Script.Globals["current_height"] = (Func <float>)GetCurrentY; _Script.Globals["current_rotation"] = (Func <float>)GetCurrentRotation; _Script.Globals["current_rho"] = (Func <float>)GetCurrentRho; _Script.Globals["current_theta"] = (Func <float>)GetCurrentTheta; }
void Start() { instance = this; Initialize(); }