Пример #1
0
 private void DestroyFood(FoodView foodView)
 {
     if (foodView != null)
     {
         foodView.Unbind();
         Destroy(foodView.gameObject);
     }
 }
Пример #2
0
        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);
        }
Пример #3
0
        public void Release()
        {
            _isReleased = true;

            _view = null;
        }