예제 #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;
        }