Skip to content

Instantly share code, notes, and snippets.

View yuiwong's full-sized avatar
🏠
Oooops!

Yui Wong yuiwong

🏠
Oooops!
View GitHub Profile
@yuiwong
yuiwong / Inventory.cs
Last active July 31, 2018 14:59
Inventory System
using System.Collections.Generic;
public abstract class Inventory
{
protected Creature m_Owner;
protected List<Item> m_Items;
public virtual void Init(Creature owner)
{
@yuiwong
yuiwong / BTDecorator.cs
Last active July 31, 2018 14:52
EventDriven-BehaviorTree : snapshot
using System;
using UnityEngine;
namespace LimboBehaviorTree
{
// @Note: if decorator require tick(float), TickCompleted must be called later, otherwise this node will tick forever!!!
// @Note: decorator tick is not that much of usage, since parent stopped, the host of decorator status will be abortByParent, then there's no tick passthrough.
// represent pulse passthrough condition.
public abstract class BTDecorator : BTTickNode
@yuiwong
yuiwong / PrePlayOption.cs
Created July 31, 2018 15:19
random editor scripts, @note: my advise is don't use editor scriptings, garbage shithole in design.
using UnityEditor;
using UnityEngine;
// allow do something before/after playmode
[InitializeOnLoad]
public static class PrePlayOptions
{
static PrePlayOptions()
{
EditorApplication.playModeStateChanged -= OnPlayModeStateChange;