Skip to content

Instantly share code, notes, and snippets.

@jonbro
Created November 5, 2014 23:18
Show Gist options
  • Select an option

  • Save jonbro/35e1066a8ca4d0b369fc to your computer and use it in GitHub Desktop.

Select an option

Save jonbro/35e1066a8ca4d0b369fc to your computer and use it in GitHub Desktop.
supertrigger
[Serializable]
public class ActionInput{
public enum ActionType
{
ENTER_TRIGGER,
EXIT_TRIGGER,
STAY_TRIGGER,
OBJECT_ACTIVE,
PRESS_KEY
}
public KeyCode keyToPress;
public ActionInput.ActionType action;
public GameObject objectCheck;
}
[Serializable]
public class ActionOutput{
public enum ActionType
{
PLAY_SOUND,
ENABLE_OBJECT,
DISABLE_OBJECT,
ENABLE_COMPONENT,
DISABLE_COMPONENT,
SET_TEXT,
SINGLE_EXECUTION // only one group can execute on the frame this one does
}
public float StartTime;
public GameObject targetObject;
public ActionOutput.ActionType action;
public string textTarget;
}
[Serializable]
public class TriggerGroup{
public string GroupName;
public List<ActionInput> actionInputs;
public List<ActionOutput> actionOutputs;
}
public class SuperTrigger : MonoBehaviour
{
public List<TriggerGroup> triggerGroups;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment