private void DestroyFood(FoodView foodView) { if (foodView != null) { foodView.Unbind(); Destroy(foodView.gameObject); } }
private FoodView CreateFood(Food food) { if (food == null) { return(null); } GameObject prefab = Resources.Load <GameObject>(food.Data["Prefab"].StringValue); GameObject go = Instantiate <GameObject>(prefab); go.name = prefab.name; go.transform.SetParent(Root); FoodView view = go.EnsureComponent <FoodView>(); view.Bind(food); return(view); }
public void Release() { _isReleased = true; _view = null; }