internal void SetSaberColor(Color?colorNullable) { if (colorNullable.HasValue) { _bsm.ChangeColor(colorNullable.Value); } }
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; } }
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; }
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); } }
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); } }
public static void SetType(this Saber saber, SaberType type, ColorManager colorManager) { saber.ChangeType(type); saber.ChangeColor(colorManager.ColorForSaberType(type)); }