(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /* C# code that sets up the mip colors texture: | |
| s_MipColorsTexture = new Texture2D (32, 32, TextureFormat.RGBA32, true); | |
| s_MipColorsTexture.hideFlags = HideFlags.HideAndDontSave; | |
| Color[] colors = new Color[6]; | |
| colors[0] = new Color (0.0f, 0.0f, 1.0f, 0.8f); | |
| colors[1] = new Color (0.0f, 0.5f, 1.0f, 0.4f); | |
| colors[2] = new Color (1.0f, 1.0f, 1.0f, 0.0f); // optimal level | |
| colors[3] = new Color (1.0f, 0.7f, 0.0f, 0.2f); | |
| colors[4] = new Color (1.0f, 0.3f, 0.0f, 0.6f); | |
| colors[5] = new Color (1.0f, 0.0f, 0.0f, 0.8f); |
| // | |
| // imgui_color_gradient.cpp | |
| // imgui extension | |
| // | |
| // Created by David Gallardo on 11/06/16. | |
| #include "imgui_color_gradient.h" | |
| #include "imgui_internal.h" |
| ## Unity ## | |
| *.cs diff=csharp text | |
| *.cginc text | |
| *.shader text | |
| *.mat merge=unityyamlmerge eol=lf | |
| *.anim merge=unityyamlmerge eol=lf | |
| *.unity merge=unityyamlmerge eol=lf | |
| *.prefab merge=unityyamlmerge eol=lf |
| // Creating a node graph editor for ImGui | |
| // Quick demo, not production code! This is more of a demo of how to use ImGui to create custom stuff. | |
| // Better version by @daniel_collin here https://gist.github.com/emoon/b8ff4b4ce4f1b43e79f2 | |
| // See https://github.com/ocornut/imgui/issues/306 | |
| // v0.02 | |
| // Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif | |
| // NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h" | |
| // Here we only declare simple +/- operators so others don't leak into the demo code. | |
| static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); } |
| bool ASMutator_WeaponReplacement::CheckRelevance_Implementation(AActor* Other) | |
| { | |
| ASWeaponPickup* WeaponPickup = Cast<ASWeaponPickup>(Other); | |
| if (WeaponPickup) | |
| { | |
| for (int32 i = 0; i < WeaponsToReplace.Num(); i++) | |
| { | |
| const FReplacementInfo& Info = WeaponsToReplace[i]; | |
| if (Info.FromWeapon == WeaponPickup->WeaponClass) |
| // Creating a node graph editor for Dear ImGui | |
| // Quick sample, not production code! | |
| // This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff, | |
| // which ended up feeding a thread full of better experiments. | |
| // See https://github.com/ocornut/imgui/issues/306 for details | |
| // Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors | |
| // Changelog | |
| // - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic(). |
| // clang -Wall -Wextra -std=c11 sizeof.c -o sizeof | |
| // emcc -Wall -Wextra -std=c11 sizeof.c -o sizeof.js | |
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| #include <stddef.h> | |
| #include <stdio.h> | |
| #include <wchar.h> | |
| #include <time.h> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| Shader "Projector/Light" { | |
| Properties { | |
| _Color ("Main Color", Color) = (1,1,1,1) | |
| _ShadowTex ("Cookie", 2D) = "" {} | |
| _FalloffTex ("FallOff", 2D) = "" {} | |
| } | |
| Subshader { | |
| Pass { | |
| ZWrite Off |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |