示例#1
0
        //
        static protected void Initialize()
        {
            if (initialized)
            {
                return;
            }

            // Determine graphics device type
            device = SystemInfo.graphicsDeviceType;

            // Initialize shader property constants
            ShaderPropertyID.Initialize();

            // Initialize shaders and materials
            int l = shaderPaths.Length;

            shaders   = new Shader[l];
            materials = new Material[l];
            for (int i = 0; i < l; i++)
            {
                Shader shader = Shader.Find(shaderPaths[i]);
                shaders[i] = shader;

                Material material = new Material(shader);
                materials[i] = material;
            }

            // Initialize static RenderTargetIdentifier(s)
            cameraTargetID = new RenderTargetIdentifier(BuiltinRenderTextureType.CameraTarget);

            // Create static quad mesh
            CreateQuad();

            initialized = true;
        }
示例#2
0
        //
        private void Awake()
        {
            ShaderPropertyID.Initialize();

            tr = GetComponent <Transform>();

            renderersDirty = true;
            seeThrough     = zTest = true;
            mode           = Mode.None;
            stencilRef     = true;

            // Initial highlighting state
            once             = false;
            flashing         = false;
            occluder         = false;
            transitionValue  = transitionTarget = 0f;
            onceColor        = Color.red;
            flashingFreq     = 2f;
            flashingColorMin = new Color(0f, 1f, 1f, 0f);
            flashingColorMax = new Color(0f, 1f, 1f, 1f);
            constantColor    = Color.yellow;
        }