Пример #1
0
        internal BombColorizer(NoteControllerBase noteController)
        {
            _bombRenderer = noteController.gameObject.GetComponentInChildren <Renderer>();
            OriginalColor = _bombRenderer.material.GetColor("_SimpleColor");

            Colorizers.Add(noteController, this);
        }
Пример #2
0
        private static List <ParticleColorizer> GetOrCreateColorizerList(BeatmapEventType eventType)
        {
            if (!Colorizers.TryGetValue(eventType, out List <ParticleColorizer> colorizers))
            {
                colorizers = new List <ParticleColorizer>();
                Colorizers.Add(eventType, colorizers);
            }

            return(colorizers);
        }
Пример #3
0
        internal ObstacleColorizer(ObstacleControllerBase obstacleController)
        {
            StretchableObstacle stretchableObstacle = obstacleController.GetComponent <StretchableObstacle>();

            _obstacleFrame                    = _obstacleFrameAccessor(ref stretchableObstacle);
            _obstacleFakeGlow                 = _obstacleFakeGlowAccessor(ref stretchableObstacle);
            _addColorMultiplier               = _addColorMultiplierAccessor(ref stretchableObstacle);
            _obstacleCoreLerpToWhiteFactor    = _obstacleCoreLerpToWhiteFactorAccessor(ref stretchableObstacle);
            _materialPropertyBlockControllers = _materialPropertyBlockControllersAccessor(ref stretchableObstacle);

            if (obstacleController is ObstacleController trueObstacleController)
            {
                OriginalColor = _colorManagerAccessor(ref trueObstacleController).obstaclesColor;
            }
            else
            {
                // Fallback
                OriginalColor = Color.white;
            }

            Colorizers.Add(obstacleController, this);
        }
Пример #4
0
        internal NoteColorizer(NoteControllerBase noteController)
        {
            _noteController = noteController;

            Colorizers.Add(noteController, this);
        }
Пример #5
0
        internal LightColorizer(LightSwitchEventEffect lightSwitchEventEffect, BeatmapEventType beatmapEventType)
        {
            _lightSwitchEventEffect = lightSwitchEventEffect;
            _eventType = beatmapEventType;
            InitializeSO("_lightColor0", 0);
            InitializeSO("_highlightColor0", 0);
            InitializeSO("_lightColor1", 1);
            InitializeSO("_highlightColor1", 1);
            InitializeSO("_lightColor0Boost", 2);
            InitializeSO("_highlightColor0Boost", 2);
            InitializeSO("_lightColor1Boost", 3);
            InitializeSO("_highlightColor1Boost", 3);

            // AAAAAA PROPAGATION STUFFF
            LightWithIdManager lightManager = _lightManagerAccessor(ref lightSwitchEventEffect);

            Lights = _lightsAccessor(ref lightManager)[lightSwitchEventEffect.lightsId].ToList();

            IDictionary <int, List <ILightWithId> > lightsPreGroup = new Dictionary <int, List <ILightWithId> >();

            TrackLaneRingsManager[] managers = UnityEngine.Object.FindObjectsOfType <TrackLaneRingsManager>();
            foreach (ILightWithId light in Lights)
            {
                if (light is MonoBehaviour monoBehaviour)
                {
                    int z = Mathf.RoundToInt(monoBehaviour.transform.position.z);

                    TrackLaneRing ring = monoBehaviour.GetComponentInParent <TrackLaneRing>();
                    if (ring != null)
                    {
                        TrackLaneRingsManager mngr = managers.FirstOrDefault(it => it.Rings.IndexOf(ring) >= 0);
                        if (mngr != null)
                        {
                            z = 1000 + mngr.Rings.IndexOf(ring);
                        }
                    }

                    if (lightsPreGroup.TryGetValue(z, out List <ILightWithId> list))
                    {
                        list.Add(light);
                    }
                    else
                    {
                        list = new List <ILightWithId>()
                        {
                            light
                        };
                        lightsPreGroup.Add(z, list);
                    }
                }
            }

            LightsPropagationGrouped = new ILightWithId[lightsPreGroup.Count][];
            int i = 0;

            foreach (List <ILightWithId> lightList in lightsPreGroup.Values)
            {
                if (lightList is null)
                {
                    continue;
                }

                LightsPropagationGrouped[i] = lightList.ToArray();
                i++;
            }

            // ok we done
            Colorizers.Add(beatmapEventType, this);
        }