private void HandleObstacleDidStartMovementEvent(BeatmapObjectSpawnController obstacleSpawnController, ObstacleController obstacleController) { try { StretchableObstacle stretchableObstacle = ReflectionUtil.GetField <StretchableObstacle>(obstacleController, "_stretchableObstacle"); StretchableCube stretchableCoreOutside = ReflectionUtil.GetField <StretchableCube>(stretchableObstacle, "_stretchableCoreOutside"); StretchableCube stretchableCoreInside = ReflectionUtil.GetField <StretchableCube>(stretchableObstacle, "_stretchableCoreInside"); bool didRecolour = VFX.VFXRainbowBarriers.IsRainbowWalls(); ChromaHandleBarrierSpawnedEvent?.Invoke(ref stretchableObstacle, ref stretchableCoreOutside, ref stretchableCoreInside, ref obstacleSpawnController, ref obstacleController, ref didRecolour); if (!didRecolour) { RecolourWall(stretchableCoreInside, obstacleController.obstacleData.time); RecolourWall(stretchableCoreOutside, obstacleController.obstacleData.time); } } catch (Exception e) { ChromaLogger.Log(e); } }
private void HandleObstacleDidStartMovementEvent(BeatmapObjectSpawnController obstacleSpawnController, ObstacleController obstacleController) { try { StretchableObstacle stretchableObstacle = ReflectionUtil.GetField <StretchableObstacle>(obstacleController, "_stretchableObstacle"); StretchableCube stretchableCore = ReflectionUtil.GetField <StretchableCube>(stretchableObstacle, "_stretchableCore"); ParametricBoxFrameController frameController = ReflectionUtil.GetField <ParametricBoxFrameController>(stretchableObstacle, "_obstacleFrame"); ParametricBoxFakeGlowController fakeGlowController = ReflectionUtil.GetField <ParametricBoxFakeGlowController>(stretchableObstacle, "_obstacleFakeGlow"); float time = obstacleController.obstacleData.time; Color color = ColourManager.GetBarrierColour(time); frameController.color = color; fakeGlowController.color = color; bool didRecolour = VFX.VFXRainbowBarriers.IsRainbowWalls(); ChromaHandleBarrierSpawnedEvent?.Invoke(ref stretchableObstacle, ref obstacleSpawnController, ref obstacleController, ref didRecolour); if (!didRecolour && color != ColourManager.DefaultBarrierColour && color != Color.clear) { RecolourWall(stretchableCore, ColourManager.GetCorrectedBarrierColour(time)); } } catch (Exception e) { ChromaLogger.Log(e); } }