Skip to content

Instantly share code, notes, and snippets.

View chuwilliamson's full-sized avatar
:octocat:

Matthew Williamson chuwilliamson

:octocat:
View GitHub Profile
@chuwilliamson
chuwilliamson / GameEventListener.cs
Created January 25, 2018 23:16
GameEventListener Monobehaviour from Unite 2017
//credit to Ryan Hipple Schell Games
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class GameEventListener : MonoBehaviour
{
public GameEvent Event;
public UnityEvent Response;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu]
public class GameEventArgs : ScriptableObject
{
public void Raise(params Object[] args)
{
using UnityEngine;
public class GameEventArgsListener : MonoBehaviour
{
public GameEventArgs Event;
public Object Sender;
public GameEventArgsResponse Response;
private void OnEnable()
{
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Sometimes, it is useful to be able to run some editor script code in a project as soon as Unity launches without requiring action from the user.
/// You can do this by applying the InitializeOnLoad attribute to a class which has a static constructor.
/// A static constructor is a function with the same name as the class, declared static and without a return type or parameters.
/// </summary>
@chuwilliamson
chuwilliamson / PlayerController.cs
Created March 7, 2018 21:00
PlayerController to move with respect to camera
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public StringVariable Horizontal;
public StringVariable Vertical;
public StringVariable Jump;
public FloatVariable Speed;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(GameEventTrigger))]
public class GameEventTriggerEditor : Editor
{
private SerializedProperty _mEntriesProperty;
private GUIContent _mIconToolbarMinus;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Events;
namespace Zyron
{
@chuwilliamson
chuwilliamson / imgui_impl_glfw_gl3.h
Created September 13, 2018 19:13
imgui_impl_glfw_gl3.h
// ImGui GLFW binding with OpenGL3 + shaders
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#pragma once
struct GLFWwindow;
// ImGui GLFW binding with OpenGL3 + shaders
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#include <imgui.h>
#include "imgui_impl_glfw_gl3.h"
// GL_CORE/GLFW
@chuwilliamson
chuwilliamson / Texture.h
Created October 10, 2018 17:03
Header for Texture class
#pragma once
#include <string>
// a class for wrapping up an opengl texture image
class Texture {
public:
enum Format : unsigned int {