Exemple #1
0
 internal void SetSaberColor(Color?colorNullable)
 {
     if (colorNullable.HasValue)
     {
         _bsm.ChangeColor(colorNullable.Value);
     }
 }
Exemple #2
0
            internal void SetSaberColor(Color?colorNullable)
            {
                if (colorNullable.HasValue)
                {
                    Color color = colorNullable.Value;

                    _bsm.ChangeColor(color);

                    SaberBurnMarkArea saberBurnMarkArea = SaberBurnMarkArea;
                    LineRenderer[]    lineRenderers     = _lineRenderersAccessor(ref saberBurnMarkArea);
                    lineRenderers[(int)_saberType].startColor = color;
                    lineRenderers[(int)_saberType].endColor   = color;
                }
            }
Exemple #3
0
            internal void SetSaberColor(Color color)
            {
                if (color == _lastColor)
                {
                    return;
                }

                _bsm.ChangeColor(color);
                _lastColor = color;

                SaberBurnMarkArea saberBurnMarkArea = SaberBurnMarkArea;

                LineRenderer[] lineRenderers = _lineRenderersAccessor(ref saberBurnMarkArea);
                lineRenderers[(int)_saberType].startColor = color;
                lineRenderers[(int)_saberType].endColor   = color;
            }
Exemple #4
0
        internal static IEnumerator ChangeColorCoroutine(Saber saber, Color color, float time = 0.05f)
        {
            if (time != 0)
            {
                yield return(new WaitForSeconds(time));
            }
            SaberModelController modelController = saber.gameObject.GetComponentInChildren <SaberModelController>(true);

            if (modelController is IColorable colorable)
            {
                colorable.SetColor(color);
            }
            if (modelController is SaberModelController smc)
            {
                Color tintColor = Accessors.ModelInitData(ref smc).trailTintColor;
                SetSaberGlowColor[]     setSaberGlowColors     = Accessors.SaberGlowColor(ref smc);
                SetSaberFakeGlowColor[] setSaberFakeGlowColors = Accessors.FakeSaberGlowColor(ref smc);
                TubeBloomPrePassLight   light = Accessors.SaberLight(ref smc);
                saber.ChangeColor(color, smc, tintColor, setSaberGlowColors, setSaberFakeGlowColors, light);
            }
        }
Exemple #5
0
        private static IEnumerator ChangeColorCoroutine(Saber saber, Color color, float time = 0.05f)
        {
            if (time != 0)
            {
                yield return(new WaitForSeconds(time));
            }
            ISaberModelController modelController = saber.gameObject.GetComponentInChildren <ISaberModelController>(true);

            if (modelController is BasicSaberModelController bsmc)
            {
                Color tintColor = ModelInitData(ref bsmc).trailTintColor;
                SetSaberGlowColor[]     setSaberGlowColors     = SaberGlowColor(ref bsmc);
                SetSaberFakeGlowColor[] setSaberFakeGlowColors = FakeSaberGlowColor(ref bsmc);
                Light light = SaberLight(ref bsmc);
                saber.ChangeColor(color, bsmc, tintColor, setSaberGlowColors, setSaberFakeGlowColors, light);
            }
            else if (modelController is IColorable colorable)
            {
                colorable.SetColor(color);
            }
        }
Exemple #6
0
 public static void SetType(this Saber saber, SaberType type, ColorManager colorManager)
 {
     saber.ChangeType(type);
     saber.ChangeColor(colorManager.ColorForSaberType(type));
 }