public void Reload() { ClearInternal(); components.Clear(); ComponentsLoaded = false; content = CurrentSkin.GetDrawableComponent(new SkinnableTargetComponent(Target)) as SkinnableTargetComponentsContainer; cancellationSource?.Cancel(); cancellationSource = null; if (content != null) { LoadComponentAsync(content, wrapper => { AddInternal(wrapper); components.AddRange(wrapper.Children.OfType <ISkinnableDrawable>()); ComponentsLoaded = true; }, (cancellationSource = new CancellationTokenSource()).Token); } else { ComponentsLoaded = true; } }
private void Start() { _playerController = PlayerController.instance; _playerController.SetAnimator(CurrentSkin.GetComponent <Animator>()); _uiManager = UIManager.instance; _uiManager.SetShopCar(SkinNum); }
private void updateHitPosition() { float hitPosition = CurrentSkin.GetConfig <LegacyManiaSkinConfigurationLookup, float>( new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.HitPosition))?.Value ?? ManiaStage.HIT_TARGET_POSITION; if (direction.Value == ScrollingDirection.Up) { hitTarget.Anchor = hitTarget.Origin = Anchor.TopLeft; Padding = new MarginPadding { Top = hitPosition }; Explosions.Padding = new MarginPadding { Top = DefaultNotePiece.NOTE_HEIGHT }; } else { hitTarget.Anchor = hitTarget.Origin = Anchor.BottomLeft; Padding = new MarginPadding { Bottom = hitPosition }; Explosions.Padding = new MarginPadding { Bottom = DefaultNotePiece.NOTE_HEIGHT }; } }
private void updateSample() { if (sampleInfo == null) { return; } var sample = CurrentSkin.GetSample(sampleInfo); if (sample == null && AllowDefaultFallback) { foreach (var lookup in sampleInfo.LookupNames) { if ((sample = sampleStore.Get(lookup)) != null) { break; } } } if (sample == null) { return; } sampleContainer.Add(Sample = new DrawableSample(sample)); // Start playback internally for the new sample if the previous one was playing beforehand. if (wasPlaying && Looping) { Play(); } }
private void updateAccentColour() { if (HitObject is IHasComboInformation combo) { var comboColours = CurrentSkin.GetConfig <GlobalSkinConfiguration, List <Color4> >(GlobalSkinConfiguration.ComboColours)?.Value; AccentColour.Value = comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White; } }
private void updateComboColour() { if (!(HitObject is IHasComboInformation)) { return; } var comboColours = CurrentSkin.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value; AccentColour.Value = GetComboColour(comboColours); }
protected void UpdateComboColour() { if (!(HitObject is IHasComboInformation combo)) { return; } var comboColours = CurrentSkin.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value ?? Array.Empty <Color4>(); AccentColour.Value = combo.GetComboColour(comboColours); }
private void updateBallTint() { if (CurrentSkin == null) { return; } bool allowBallTint = CurrentSkin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.AllowSliderBallTint)?.Value ?? false; Ball.AccentColour = allowBallTint ? AccentColour.Value : Color4.White; }
private void Start() { DontDestroyOnLoad(gameObject); if (playerInstance == null) { playerInstance = this; } else { Object.Destroy(gameObject); } }
protected virtual void UpdateHitPosition() { float hitPosition = CurrentSkin.GetConfig <ManiaSkinConfigurationLookup, float>( new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.HitPosition))?.Value ?? Stage.HIT_TARGET_POSITION; Padding = Direction.Value == ScrollingDirection.Up ? new MarginPadding { Top = hitPosition } : new MarginPadding { Bottom = hitPosition }; }
/// <summary> /// Reload all components in this container from the current skin. /// </summary> public void Reload() { ClearInternal(); components.Clear(); content = CurrentSkin.GetDrawableComponent(new SkinnableTargetComponent(Target)) as SkinnableTargetComponentsContainer; if (content != null) { LoadComponentAsync(content, wrapper => { AddInternal(wrapper); components.AddRange(wrapper.Children.OfType <ISkinnableDrawable>()); }); } }
private void updateSample() { if (sampleInfo == null) { return; } var sample = CurrentSkin.GetSample(sampleInfo); if (sample == null) { return; } sampleContainer.Add(Sample = new DrawableSample(sample)); // Start playback internally for the new sample if the previous one was playing beforehand. if (wasPlaying && Looping) { Play(); } }
protected override void Initialize() { CurrentSkin.SetActive(true); }