Skip to content

Instantly share code, notes, and snippets.

@RubenPineda
RubenPineda / State.cs
Last active September 9, 2020 01:07
Finite state machine system for Unity. Includes a wizard to create new state machines with their own states. A state machine can be used for programming character behaviors, different player states or maybe different types of cameras.
// Rubén Pineda 2020
using UnityEngine;
using System.Collections;
using System;
namespace StateMachine {
public interface IState {
void Synchronize ();
void Desynchronize ();
@RubenPineda
RubenPineda / DraggablePointAttribute.cs
Last active September 9, 2020 00:00
This is an updated version of ProGM's script. Now it handles Vector2, arrays and nested fields as well. You can also drag points locally. See the original code here: https://gist.github.com/ProGM/226204b2a7f99998d84d755ffa1fb39a. See also helper methods here: http://answers.unity3d.com/questions/425012/get-the-instance-the-serializedproperty-bel…
using UnityEngine;
public class DraggablePointAttribute : PropertyAttribute {
public bool local;
public DraggablePointAttribute (bool local = false) {
this.local = local;
}
}