Beispiel #1
0
        private void GenerateNoiseTextures(RenderTextureDescriptor rtdesc)
        {
            if (noiseTextures == null || noiseTextures.Length != gradations.Length)
            {
                if (noiseTextures != null)
                {
                    foreach (var ntex in noiseTextures)
                    {
                        ntex.Dispose();
                    }
                }
                noiseTextures = new ScopedObject <RenderTexture> [gradations.Length];
            }
            for (var i = 0; i < noiseTextures.Length; i++)
            {
                if (noiseTextures[i] == null)
                {
                    noiseTextures[i] = new ScopedObject <RenderTexture>(
                        new RenderTexture(rtdesc));
                }

                var tex = noiseTextures[i];
                Graphics.Blit(null, tex, noiseMat);
                noiseTextures[i] = new ScopedObject <RenderTexture>(tex);
            }
        }
Beispiel #2
0
 protected virtual void CaptureDirect(RenderTexture src)
 {
     using (var tex = new ScopedObject <Texture2D>(
                Texture2DExtension.Create(src.width, src.height, TextureFormat.ARGB32, false, false)))
         using (new RenderTextureActivator(src)) {
             tex.Data.ReadPixels(new Rect(0, 0, src.width, src.height), 0, 0);
             serializer.Serialize(tex);
         }
 }
Beispiel #3
0
 public HomeController(TransientObject transientObject1, TransientObject transientObject2, ScopedObject scopedObject1, ScopedObject scopedObject2, SingletonObject singletonObject1, SingletonObject singletonObject2)
 {
     this.transientObject1 = transientObject1;
     this.transientObject2 = transientObject2;
     this.scopedObject1    = scopedObject1;
     this.scopedObject2    = scopedObject2;
     this.singletonObject1 = singletonObject1;
     this.singletonObject2 = singletonObject2;
 }
Beispiel #4
0
        void OnEnable()
        {
            if (shader == null)
            {
                shader = Shader.Find(SHADER_BLENDING);
            }
            mat          = new Material(shader);
            worldMatrix  = new UvToWorldMatrix();
            edgeMatrices = new EdgeToLocalUvMatrix();
            uvMatrix     = new LocalToWorldUvMatrix();

            UpdateInputData();
        }
Beispiel #5
0
        public virtual object get <T1>(string name, ObjectFactory <T1> objectFactory)
        {
            ExecutionEntity executionEntity = null;

            try
            {
                logger.fine("returning scoped object having beanName '" + name + "' for conversation ID '" + this.ConversationId + "'. ");

                ProcessInstance processInstance = Context.ExecutionContext.ProcessInstance;
                executionEntity = (ExecutionEntity)processInstance;

                object scopedObject = executionEntity.getVariable(name);
                if (scopedObject == null)
                {
                    scopedObject = objectFactory.Object;
                    if (scopedObject is ScopedObject)
                    {
                        ScopedObject sc = (ScopedObject)scopedObject;
                        scopedObject = sc.TargetObject;
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
                        logger.fine("de-referencing " + typeof(ScopedObject).FullName + "#targetObject before persisting variable");
                    }
                    persistVariable(name, scopedObject);
                }
                return(createDirtyCheckingProxy(name, scopedObject));
            }
            catch (Exception th)
            {
                logger.warning("couldn't return value from process scope! " + StringUtil.getStackTrace(th));
            }
            finally
            {
                if (executionEntity != null)
                {
                    logger.fine("set variable '" + name + "' on executionEntity# " + executionEntity.Id);
                }
            }
            return(null);
        }
Beispiel #6
0
            public void GenerateGradiantTexture()
            {
                if (tex == null)
                {
                    tex = new ScopedObject <Texture2D>(
                        new Texture2D(1, 1, TextureFormat.RGBAHalf, false, true));
                }

                tex.Data.filterMode = FilterMode.Bilinear;
                tex.Data.wrapMode   = wrapMode;
                tex.Data.Resize(TEX_DENSITY, 1);

                var pixels = tex.Data.GetPixels();
                var dx     = 1f / (tex.Data.width - 1);

                for (var i = 0; i < tex.Data.width; i++)
                {
                    var c = grad.Evaluate(i * dx);
                    pixels[i] = c.linear;
                }
                tex.Data.SetPixels(pixels);
                tex.Data.Apply();
            }