protected virtual void PostRender() { if (PostRenderEvent != null) { PostRenderEvent.Invoke(this); } }
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; } } }
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; } }
public static DetourEvent PostDrawCallback(StaticContextAccessor accessor) { var batch = accessor._GetSpriteBatch(); batch.Begin(); var @event = new PostRenderEvent(); FireEvent(@event); batch.End(); return(@event); }
public static void RemoveEvent(Camera camera, CameraEventHandler onPostRenderEvent) { if (camera == null) { return; } PostRenderEvent e = camera.GetComponent <PostRenderEvent>(); if (e != null) { e.OnEvent -= onPostRenderEvent; } }
// 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); }
public static void RaisePostRender(GooseEntity goose, Graphics g) { PostRenderEvent?.Invoke(goose, g); }