TileScript.OnRecycle C# (CSharp) Method

OnRecycle() public method

Called when the tile is about to be returned to the object pool.
public OnRecycle ( ) : void
return void
    public void OnRecycle()
    {
        // Cleanup grass child object if it's still there
        var grass = GetGrassChild();
        if (grass)
        {
            ObjectPooler.Instance.ReturnPooledObject(grass);
        }

        // Cleanup particle systems
        ObjectPooler.Instance.ReturnPooledObject(hintFX.gameObject);
        ObjectPooler.Instance.ReturnPooledObject(explodeFX.gameObject);
    }