private void Init() { backgroundDisplay = CreateChild <BackgroundDisplay>("background", 0); { backgroundDisplay.Anchor = AnchorType.Fill; backgroundDisplay.Offset = Offset.Zero; } metronomeContainer = CreateChild <MetronomeContainer>("metronome-container", 1); { metronomeContainer.Anchor = AnchorType.BottomStretch; metronomeContainer.SetOffsetHorizontal(0f); metronomeContainer.Y = 140f; metronomeContainer.Height = 64f; } mapsetSlider = CreateChild <OffsetSlider>("mapset", 2); { mapsetSlider.Anchor = AnchorType.Bottom; mapsetSlider.Position = new Vector3(-240f, 56f); mapsetSlider.Size = new Vector2(400f, 100f); mapsetSlider.LabelText = "Mapset offset"; } mapSlider = CreateChild <OffsetSlider>("map", 3); { mapSlider.Anchor = AnchorType.Bottom; mapSlider.Position = new Vector3(240f, 56f); mapSlider.Size = new Vector2(400f, 100f); mapSlider.LabelText = "Map offset"; } OnEnableInited(); }
// Use this for initialization void Awake() { _instance = this; this.videoPlayer1 = new GamePreviewDisplayTexture(previewTex1); this.videoPlayer2 = new GamePreviewDisplayTexture(previewTex2); _allFadeables = new GamePreviewDisplayTexture[] { videoPlayer1, videoPlayer2 }; //zero out all fadeables //so an irrelevant one doesn't block an active one foreach (GamePreviewDisplayTexture f in _allFadeables) { f.alpha = 0; } }