StaticBackground

From Unify Community Wiki
Revision as of 10:00, 7 December 2009 by Ryan scott (Talk | contribs)

Jump to: navigation, search

This script allows you to have a static image as the background to your scene. Like a skybox that doesn't move.

StaticBackground.cs

C#

<csharp> // You can place this directly onto your camera.

using UnityEngine;

[ExecuteInEditMode] [AddComponentMenu("Image Effects/Static Background")] public class StaticBackground : MonoBehaviour {

   public Texture2D background;
   [RenderBeforeQueues( 1000 )]
   void OnRenderObject( int queueIndex ) {
       if( background != null )
           Graphics.Blit( background, RenderTexture.active );
   }

} </csharp>


Feel free to ask me any questions regarding this script

 -Ryan Scott-
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox