Skip to content

Instantly share code, notes, and snippets.

ryanzec / AIController.cs
Last active May 19, 2019
Unity Utility Based AI Setup
View AIController.cs
using System.Collections.Generic;
using UnityEngine;
namespace UGPXFramework {
public class AIController {
private DynamicBlackboard _blackboard = new DynamicBlackboard();
private List<IAIScan> _scans = new List<IAIScan>();
private List<IAIAction> _actions = new List<IAIAction>();
public AIController(GameObject gameObject) {
ryanzec / patterns.js
Created Mar 6, 2019
random frontend patterns
View patterns.js
// avoid popup blocker when you need async code when opening new tab\
// NOTE: the downside to this approach it the the user will see a blank page until the async method finished but instead of opening
// NOTE: to a blank page, you could probably have a redirect page that has animation or something
//first have a method that does the async functionality and get passed in the new tab window
const doRedirect = async (newWindow) => {
try {
const redirectUrl = await api.getRedirectUrl();
ryanzec / examples.cpp
Created May 29, 2018
c++ / sdl / etc examples
View examples.cpp
// @example scrolling example
bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);
if (mouseInUiNow && !mouseInUi) {
mouseInUi = true;
} else if (!mouseInUiNow && mouseInUi) {
mouseInUi = false;
ryanzec / .gitignore
Created Sep 11, 2017
Unity .gitignore file (Using Rider IDE)
View .gitignore
# Exclude 3rd party libraries installed from the assets store
[Aa]ssets/Asset Store Resources/
# Some asset tools can't be moved so need to explicitly
ryanzec / .editorconfig
Created Aug 23, 2014
My standard editor config file
View .editorconfig
root = true
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true