private static void Postfix(LimHoldNoteManager __instance, LanotaHoldNote Note)
        {
            var worker = Note.HoldNoteGameObject.AddComponent <HoldLineWorker>();

            worker.TouchMaterial   = __instance.HoldTouch;
            worker.UnTouchMaterial = __instance.HoldUntouch;
            worker.Note            = Note;
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        private static void Prefix(LimHoldNoteManager __instance)
        {
            var bundle = AssetBundle.LoadFromFile(Application.streamingAssetsPath + "/Assets/curvedrail");

            if (bundle == null)
            {
                Debug.Log("Failed to load AssetBundle!");
                return;
            }

            __instance.HoldTouch   = bundle.LoadAsset <Material>("Rail_Pressed");
            __instance.HoldUntouch = bundle.LoadAsset <Material>("Rail_Unpressed");

            bundle.Unload(false);
        }