Skip to content

Instantly share code, notes, and snippets.

@enue
Created February 18, 2017 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enue/9999df944dd39bd1fc3a2677e14db26e to your computer and use it in GitHub Desktop.
Save enue/9999df944dd39bd1fc3a2677e14db26e to your computer and use it in GitHub Desktop.
[Unity] UIVerticesPool
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TSKT
{
public static class UIVerticesPool
{
static System.WeakReference verticesBuffer;
public static List<UIVertex> Get()
{
List<UIVertex> result = null;
if (verticesBuffer != null)
{
result = verticesBuffer.Target as List<UIVertex>;
}
if (result == null)
{
result = new List<UIVertex>();
verticesBuffer = new System.WeakReference(result);
}
return result;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment