Created
February 18, 2017 03:01
-
-
Save enue/9999df944dd39bd1fc3a2677e14db26e to your computer and use it in GitHub Desktop.
[Unity] UIVerticesPool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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