Skip to content

Instantly share code, notes, and snippets.

View chuwilliamson's full-sized avatar
:octocat:

Matthew Williamson chuwilliamson

:octocat:
View GitHub Profile
#pragma once
#include "Application.h"
#include <Renderer2D.h>
class RPG_Application : public aie::Application
{
public:
RPG_Application();
virtual ~RPG_Application();
bool startup() override;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(GameEventTrigger))]
public class GameEventTriggerEditor : Editor
{
private SerializedProperty _mEntriesProperty;
private GUIContent _mIconToolbarMinus;
@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;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu]
public class GameEventArgs : ScriptableObject
{
public void Raise(params Object[] args)
{
@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;
@chuwilliamson
chuwilliamson / GameEvent.cs
Last active February 3, 2024 15:27
GameEvent ScriptableObject from Unite 2017
/// Credit to Ryan Hipple from Schell Games
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
/// <summary>
/// Create a GameEvent in the Project View
/// This Event should be something meaningful. Ex: GameStart
/// The GameStart.asset will have its reference used in the project
using System;
using UnityEngine;
class TranInputController : MonoBehaviour
{
Animator anim;
void Update()
{
if(Input.GetKeyDown(KeyCode.D))
{
@chuwilliamson
chuwilliamson / astar.cs
Created May 10, 2016 22:54
Astar Unity
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class AStar : MonoBehaviour
{
public enum State
{
def Run(self):
self.Reset()
open = self.OPEN
closed = self.CLOSED
start = self._start
goal = self._goal
open.append(start)
print(open)
while open:
open.sort(key = lambda x : x.f)
@chuwilliamson
chuwilliamson / FSM.cs
Created February 24, 2016 15:36
FSM in c#
//written by Ryan adaire aka the boss aka commit dis aka ya boy aka holla at
using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
public class FSM<T>
{
private List<TransitionObject> good_transitions;