コード例 #1
0
        private void PlaceBuilding()
        {
            GameObject placedObject = Instantiate(_placingGameObject, _placingGameObject.transform.position, _placingGameObject.transform.rotation);
            //Can possibly be refactored into the ConstructionObject's start method
            ConstructionObject constructionObject = placedObject.GetComponent <ConstructionObject>();

            constructionObject.PlaceObject();
            //

            GridController.Get.PlaceObjectOnGrid(constructionObject.transform.position, constructionObject.Shape);
            CancelBuildMode();
        }
コード例 #2
0
 public void SetBuilding(ConstructionObject construction)
 {
     _placingGameObject  = Instantiate(construction.gameObject);
     _constructionObject = _placingGameObject.GetComponent <ConstructionObject>();
     _buildMode          = true;
 }