Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
 private void Start()
 {
     _playerController = PlayerController.instance;
     _playerController.SetAnimator(CurrentSkin.GetComponent <Animator>());
     _uiManager = UIManager.instance;
     _uiManager.SetShopCar(SkinNum);
 }
Exemplo n.º 3
0
        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
                };
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
        private void updateComboColour()
        {
            if (!(HitObject is IHasComboInformation))
            {
                return;
            }

            var comboColours = CurrentSkin.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value;

            AccentColour.Value = GetComboColour(comboColours);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        private void updateBallTint()
        {
            if (CurrentSkin == null)
            {
                return;
            }

            bool allowBallTint = CurrentSkin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.AllowSliderBallTint)?.Value ?? false;

            Ball.AccentColour = allowBallTint ? AccentColour.Value : Color4.White;
        }
Exemplo n.º 9
0
 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
            };
        }
Exemplo n.º 11
0
        /// <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>());
                });
            }
        }
Exemplo n.º 12
0
        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();
            }
        }
Exemplo n.º 13
0
 protected override void Initialize()
 {
     CurrentSkin.SetActive(true);
 }