예제 #1
0
    public static void AddTo(GameObject obj)
    {
        StateStorage storage = obj.GetComponent <StateStorage>();

        if (storage == null)
        {
            storage = obj.AddComponent <StateStorage>();
        }

        storage.Store();
    }
예제 #2
0
    public static void Store(this Transform t)
    {
        StateStorage storer = t.GetComponent <StateStorage>();

        if (storer == null)
        {
            storer = t.gameObject.AddComponent <StateStorage>();
        }

        storer.Store();
    }
예제 #3
0
    public static StateStorage Revert(this Transform t)
    {
        StateStorage storer = t.GetComponent <StateStorage>();

        if (storer == null)
        {
            storer = t.gameObject.AddComponent <StateStorage>();
            storer.Store();
        }


        return(storer);
    }