コード例 #1
0
        internal BombColorizer(NoteControllerBase noteController)
        {
            _bombRenderer = noteController.gameObject.GetComponentInChildren <Renderer>();
            OriginalColor = _bombRenderer.material.GetColor("_SimpleColor");

            Colorizers.Add(noteController, this);
        }
コード例 #2
0
ファイル: ParticleColorizer.cs プロジェクト: JonnyXDA/Chroma
        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
ファイル: ObstacleColorizer.cs プロジェクト: JonnyXDA/Chroma
        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
ファイル: LightColorizer.cs プロジェクト: JonnyXDA/Chroma
        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);
        }