Quantcast
Channel: Questions in topic: "namespace"
Viewing all articles
Browse latest Browse all 398

Im making a fading out to screen but i get namespace 2d texture missing

$
0
0
using UnityEngine; using System.Collections; public class Fading : MonoBehaviour { public Texture2d fadeOutTexture; public float fadeSpeed = 0.8f; private int drawDepth = -1000; private float alpha = 1.0f; private int fadeDir = -1; void OnGui() { alpha += fadeDir * fadeSpeed * Time.deltaTime; alpha = Mathf.Clamp01(alpha); GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, alpha); GUI.depth = drawDepth; GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), fadeOutTexture); } public float BeginFade(int direction) { fadeDir = direction; return (fadeSpeed); } void OnLevelWasLoaded() { BeginFade(-1); } }

Viewing all articles
Browse latest Browse all 398

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>