예제 #1
0
    public void ObjectReturnsToPool()
    {
        Spawnable.Pool <Crasher> .Instance.Populate(TestEnemy.Create(0), 1);

        TestEnemy testObject = Spawnable.Pool <Crasher> .Instance.RequestObject() as TestEnemy;

        testObject.ReturnToPool <Crasher>();

        Assert.AreEqual(1, Spawnable.Pool <Crasher> .Instance.Count,
                        "No object available in the pool.");
        Assert.IsNotNull(Spawnable.Pool <Crasher> .Instance.RequestObject(),
                         "No object available to return.");
    }