protected override void LoadContent() { base.LoadContent(); Skin.Current.ButtonBrush = NineTileBrush.FromSingleTexture( Game.Screen.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/UI/buttonLong_brown.png", GraphicsDevice), 15, 15); Skin.Current.ButtonHoverBrush = NineTileBrush.FromSingleTexture( Game.Screen.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/UI/buttonLong_beige.png", GraphicsDevice), 15, 15); Skin.Current.ButtonPressedBrush = NineTileBrush.FromSingleTexture( Game.Screen.Content.LoadTexture2DFromFile("./Assets/OctoAwesome.Client/UI/buttonLong_beige_pressed.png", GraphicsDevice), 15, 15); Frame.Background = new BorderBrush(Color.CornflowerBlue); NavigateFromTransition = new AlphaTransition(Frame, Transition.Linear, TimeSpan.FromMilliseconds(200), 0f); NavigateToTransition = new AlphaTransition(Frame, Transition.Linear, TimeSpan.FromMilliseconds(200), 1f); NavigateToScreen(new MainScreen(this)); }
// Start is called before the first frame update void Start() { renderer = GetComponent <SpriteRenderer>(); currentTransition = AlphaTransition.OpaqueToAlpha; duration = interpolateDuration; light2DComponent = lightObject.GetComponent <UnityEngine.Experimental.Rendering.Universal.Light2D>(); }
void PingPongColor() { if (currentTransition == AlphaTransition.OpaqueToAlpha) { duration -= Time.deltaTime; mLerp = (interpolateDuration - duration) / interpolateDuration; renderer.color = Color.Lerp(fullColor, transparentColor, mLerp); if (mLerp >= 1) { currentTransition = AlphaTransition.AlphaToOpaque; duration = interpolateDuration; } } else { duration -= Time.deltaTime; mLerp = (interpolateDuration - duration) / interpolateDuration; renderer.color = Color.Lerp(transparentColor, fullColor, mLerp); if (mLerp >= 1) { currentTransition = AlphaTransition.OpaqueToAlpha; duration = interpolateDuration; } } }
protected override void LoadContent() { base.LoadContent(); Frame.Background = new BorderBrush(Color.CornflowerBlue); NavigateFromTransition = new AlphaTransition(Frame, Transition.Linear, TimeSpan.FromMilliseconds(200), 0f); NavigateToTransition = new AlphaTransition(Frame, Transition.Linear, TimeSpan.FromMilliseconds(200), 1f); NavigateToScreen(new MainScreen(this)); }
// Use this for initialization void Start() { menuLoad = GameObject.Find("Scripts").GetComponent<LoadScenes>(); ball = GameObject.Find("Ball").GetComponent<Ball>(); //Overlay setup sprite = GameObject.Find("Overlay").GetComponent<Image>(); startAlpha = sprite.color.a; alpha = gameObject.AddComponent<AlphaTransition>(); //MenuUIButton setup buttonTap = gameObject.GetComponent<AudioSource>(); //GameOverUI setup continueButton = GameObject.Find("Continue").GetComponent<Button>(); continuesLeftText = GameObject.Find("ContinuesLeft").GetComponent<Text>(); lastRunText = GameObject.Find("GameOverScoreText").GetComponent<Text>(); highScoreText = GameObject.Find("HighScoreText").GetComponent<Text>(); continuesLeft = 2; startUICanvas.enabled = true; inGameOverUI = false; }