void Start() { startPosition = transform.position; manager = GameObject.FindGameObjectWithTag("GameController").GetComponent <Manager>(); canvasGroup = GetComponent <CanvasGroup>(); shadow = GetComponent <UIShadow>(); image = GetComponent <Image>(); }
private void Awake() { if (m_button == null) { m_button = gameObject.GetComponent <Button>(); } if (uiShadow == null) { uiShadow = gameObject.AddComponent <UIShadow>(); uiShadow.effectDistance = new Vector2(5, 5); uiShadow.style = ShadowStyle.Outline8; } }
protected virtual void Start() { if (UI == null) { UI = FindObjectOfType <CardUISystem>(); } selected = false; if (spiritSystem == null) { spiritSystem = FindObjectOfType <SpiritSystem>(); } shadow = FindObjectOfType <UIShadow>(); shadow.effectColor = new Color(shadow.effectColor.r, shadow.effectColor.g, shadow.effectColor.b, 0); }
private void Init() { mapTagRecycler = new ManagedRecycler <MapMetaTag>(CreateMapTag); OnTriggered += () => { if (Active && Mapset != null) { if (Model.SelectedMapset.Value != Mapset) { Model.SelectMapset(Mapset); } else { Model.NavigateToPrepare(); } } }; container = CreateChild <UguiObject>("container"); { container.Anchor = AnchorType.CenterStretch; container.SetOffsetVertical(5f); container.Width = UnfocusedWidth; highlight = container.CreateChild <UguiSprite>("highlight"); { highlight.Size = new Vector2(1920f, 144f); highlight.SpriteName = "glow-128"; highlight.Alpha = UnfocusedHighlightAlpha; highlight.IsRaycastTarget = false; highlight.AddEffect(new AdditiveShaderEffect()); } glow = container.CreateChild <UguiSprite>("glow"); { glow.Anchor = AnchorType.Fill; glow.RawSize = new Vector2(30f, 30f); glow.SpriteName = "glow-circle-32"; glow.ImageType = Image.Type.Sliced; glow.Color = UnfocusedGlowColor; } thumbContainer = container.CreateChild <UguiSprite>("thumb"); { thumbContainer.Anchor = AnchorType.Fill; thumbContainer.RawSize = Vector2.zero; thumbContainer.SpriteName = "circle-32"; thumbContainer.ImageType = Image.Type.Sliced; thumbContainer.Color = Color.black; thumbContainer.AddEffect(new MaskEffect()); thumbImage = thumbContainer.CreateChild <UguiTexture>("image"); { thumbImage.Anchor = AnchorType.Fill; thumbImage.RawSize = Vector2.zero; thumbImage.Color = UnfocusedThumbColor; } } titleLabel = container.CreateChild <Label>("title"); { titleLabel.Anchor = AnchorType.TopStretch; titleLabel.Pivot = PivotType.Top; titleLabel.Y = -8f; titleLabel.Height = 32f; titleLabel.SetOffsetHorizontal(20f); titleLabel.IsItalic = true; titleLabel.IsBold = true; titleLabel.WrapText = true; titleLabel.Alignment = TextAnchor.MiddleLeft; titleLabel.FontSize = 22; titleShadow = titleLabel.AddEffect(new ShadowEffect()).Component; titleShadow.style = ShadowStyle.Shadow; titleShadow.effectColor = Color.black; titleShadow.enabled = false; } artistLabel = container.CreateChild <Label>("artist"); { artistLabel.Anchor = AnchorType.BottomStretch; artistLabel.Pivot = PivotType.Bottom; artistLabel.Y = 8f; artistLabel.Height = 24f; artistLabel.SetOffsetHorizontal(20f); artistLabel.WrapText = true; artistLabel.Alignment = TextAnchor.MiddleLeft; artistLabel.FontSize = 18; artistShadow = artistLabel.AddEffect(new ShadowEffect()).Component; artistShadow.style = ShadowStyle.Shadow; artistShadow.effectColor = Color.black; artistShadow.enabled = false; } creatorLabel = container.CreateChild <Label>("creator"); { creatorLabel.Anchor = AnchorType.BottomStretch; creatorLabel.Pivot = PivotType.Bottom; creatorLabel.Y = 8f; creatorLabel.Height = 24f; creatorLabel.SetOffsetHorizontal(20f); creatorLabel.WrapText = true; creatorLabel.Alignment = TextAnchor.MiddleRight; creatorLabel.FontSize = 18; creatorShadow = creatorLabel.AddEffect(new ShadowEffect()).Component; creatorShadow.style = ShadowStyle.Shadow; creatorShadow.effectColor = Color.black; creatorShadow.enabled = false; } mapTagGrid = container.CreateChild <UguiGrid>("map-tag-grid"); { mapTagGrid.Anchor = AnchorType.TopStretch; mapTagGrid.Pivot = PivotType.Top; mapTagGrid.Y = -8f; mapTagGrid.Height = MapTagCellSize.y; mapTagGrid.SetOffsetHorizontal(20f); mapTagGrid.Alignment = TextAnchor.MiddleRight; mapTagGrid.Axis = GridLayoutGroup.Axis.Horizontal; mapTagGrid.SpaceWidth = 8f; mapTagGrid.CellSize = MapTagCellSize; mapTagGrid.Limit = 0; } } backgroundAgent = new CacherAgent <IMap, IMapBackground>(BackgroundCacher) { UseDelayedRemove = true, RemoveDelay = 2f }; backgroundAgent.OnFinished += OnBackgroundLoaded; OnEnableInited(); }