示例#1
0
        /// <summary>
        /// Call this to build something from a Card
        /// </summary>
        /// <param name="card"></param>
        public Building BuildBuilding(BuildingBase buildingBase)
        {
            //create a clean copy of the building
            BuildingData nwBuildingData = BuildingBase.CreateBuilding(buildingBase);

            //create a builing out the new clean data
            buildingOnPlot = BuildingBase.CreateBuilding(nwBuildingData); //will instantiate a new building

            //GameObject nwBuilding = GameObject.Instantiate(buildingPrefab);
            buildingOnPlot.transform.SetParent(this.transform, false);
            buildingOnPlot.transform.localPosition = Vector3.zero;


            //disable buildingPlot model
            this.modelRef.SetActive(false);

            return(buildingOnPlot);
        }
示例#2
0
 public BuildingData(BuildingBase buildingBase)
 {
     this.prefab          = buildingBase.prefab;
     this.name            = buildingBase.name;
     this.buildingActions = buildingBase.buildingActions;
 }
示例#3
0
        public static BuildingData CreateBuilding(BuildingBase buildingBase)
        {
            BuildingData nwCardData = new BuildingData(buildingBase);

            return(nwCardData);
        }