예제 #1
0
 public void RemoveEntityPlacementController()
 {
     EPCMode = EntityPlacementControllerMode.BUY;
     if (_entityPlacementController != null)
     {
         Destroy(_entityPlacementController.gameObject);
     }
 }
예제 #2
0
 public void InteractWithEntityPlacementController(Entity entity)
 {
     if (_entityPlacementController == null)
     {
         if (entity is Building)
         {
             var buildingEntity = (entity as Building);
             if (buildingEntity.data.state == BuildingState.CONSTRUCTION)
             {
                 return;
             }
             EPCMode = EntityPlacementControllerMode.MOVE;
             SpawnEntityPlacementController();
             _entityPlacementController.footprint = buildingEntity.data.footprint;
             _entityPlacementController.PlaneMeshRenderer.sharedMaterial.SetInt("_SelectedCellX", _entityPlacementController.footprint.y - 1);
             _entityPlacementController.OriginalPosition = buildingEntity.GridPosition;
             MoveEntityPlaceControllerTo(buildingEntity.GridPosition);
             _entityPlacementController.AttachEntity(buildingEntity);
             entities.Remove(buildingEntity);
         }
     }
 }