- Home /
Question by
unity_N8ZPuHFNMf_qVQ · Dec 02, 2018 at 04:23 PM ·
texturebugnot working
Strange textures when Loading the scene
There are attached the picture when I first run the game and the other one shows when I restart the game.
Yellow/Green colors in textures are showned .
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;
using UnityEngine.UI;
public class DeathMenu : MonoBehaviour {
public Image BackgroundImg;
private bool IsShowned = false;
private float transition = 0.0f;
void Start () {
gameObject.SetActive(false);
}
void Update () {
if (!IsShowned)
return;
transition += Time.deltaTime;
BackgroundImg.color = Color.Lerp(new Color(0, 0, 0, 0), Color.black, transition);
}
public void ToggleEndMenu(int score)
{
gameObject.SetActive(true);
IsShowned = true;
}
public void ToMenu()
{
SceneManager.LoadScene( "Menu");
}
public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
normal-scene.jpg
(92.1 kB)
bug-scene.jpg
(93.5 kB)
Comment