Esempio n. 1
0
 protected virtual void PostRender()
 {
     if (PostRenderEvent != null)
     {
         PostRenderEvent.Invoke(this);
     }
 }
Esempio n. 2
0
        public void PostRenderCallback(PostRenderEvent @event)
        {
            var root  = @event.Root;
            var batch = root.SpriteBatch;
            var font  = root.SmoothFont;

            var farmer = root.Player;

            if (farmer != null)
            {
                if (!pressedLast && Keyboard.GetState().IsKeyDown(Keys.X))
                {
                    pressedLast = true;

                    var customTool = @event.Proxy <ToolAccessor, Tool>(new CustomTool());
                    customTool.Name        = "Tool name!";
                    customTool.Description = "Tool Desc! Pretty gooood.";
                    farmer.SetItem(0, customTool);

                    var customObject = @event.Proxy <ObjectAccessor, ObjectItem>(new CustomObject());
                    customObject.Name = "Object name!";
                    farmer.SetItem(1, customObject);
                }
                else if (!Keyboard.GetState().IsKeyDown(Keys.X))
                {
                    pressedLast = false;
                }
            }
        }
Esempio n. 3
0
 public void PostRender(PostRenderEvent @event)
 {
     if (@event.Root.ActiveClickableMenu != null && drawingWaitMenu)
     {
         waitMenu.Draw(@event.Root.SpriteBatch);
     }
     if (@event.Root.ActiveClickableMenu == null && drawingWaitMenu)
     {
         drawingWaitMenu = false;
     }
 }
 public void PostRender(PostRenderEvent @event)
 {
     //do we need to draw our "menu"
     if (@event.Root.ActiveClickableMenu != null && showNPC)
     {
         locs.Draw(@event.Root.SpriteBatch);
     }
     //our menu was probably closed so set draw to falses
     if (@event.Root.ActiveClickableMenu == null && showNPC)
     {
         showNPC = false;
     }
 }
Esempio n. 5
0
        public static DetourEvent PostDrawCallback(StaticContextAccessor accessor)
        {
            var batch = accessor._GetSpriteBatch();

            batch.Begin();

            var @event = new PostRenderEvent();

            FireEvent(@event);

            batch.End();
            return(@event);
        }
Esempio n. 6
0
    public static void RemoveEvent(Camera camera, CameraEventHandler onPostRenderEvent)
    {
        if (camera == null)
        {
            return;
        }

        PostRenderEvent e = camera.GetComponent <PostRenderEvent>();

        if (e != null)
        {
            e.OnEvent -= onPostRenderEvent;
        }
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     flow_texture = new RenderTexture(1024, 1024, 24);
     flow_texture.enableRandomWrite = true;
     flow_texture.filterMode        = FilterMode.Trilinear;
     flow_texture.Create();
     flow_material.SetTexture("_MainTex", flow_texture);
     particle_buffer = new ComputeBuffer(count, sizeof(float) * 6);
     switch_buffer   = new ComputeBuffer(count, sizeof(float) * 6);
     Cal_HANDLE      = particle_compute.FindKernel("Cal");
     particle_compute.SetTexture(Cal_HANDLE, "noice_texture", noice_texture);
     Init_HANDLE = particle_compute.FindKernel("Init");
     particle_compute.SetInt("count", count);
     particle_compute.SetBuffer(Init_HANDLE, "particle_buffer", particle_buffer);
     particle_compute.SetTexture(Init_HANDLE, "noice_texture", noice_texture);
     particle_compute.Dispatch(Init_HANDLE, count / 64 + 1, 1, 1);
     //Blur_HANDLE = particle_compute.FindKernel("Blur");
     PostRenderEvent.AddEvent(Camera.main, aaa);
 }
Esempio n. 8
0
 public static void RaisePostRender(GooseEntity goose, Graphics g)
 {
     PostRenderEvent?.Invoke(goose, g);
 }