Ejemplo n.º 1
0
        /// <summary>
        /// 建筑新的建筑, TEST
        /// </summary>
        public void New()
        {
            //BuildingBase building = Instantiate<GameObject>(ShipFactory.GetBuildingPrefab(BuildingType.SHIP_FACTORY)).GetComponent<BuildingBase>();
            //Build(building ,LookLandIndex,currentPlanet);

            BuildingBase building = Instantiate <GameObject>(ResourceCollector.GetBuildingPrefab(BuildingType.RESOURCE_COLLECTOR)).GetComponent <BuildingBase>();

            Build(building, LookLandIndex, currentPlanet);
        }
Ejemplo n.º 2
0
        public override T Create <T>(ID id)
        {
            GameObject        go = GameObject.Instantiate(BuildingBase.GetBuildingPrefab(BuildingType.RESOURCE_COLLECTOR));
            ResourceCollector cc = go.GetComponent <ResourceCollector>();

            id.Init();
            cc.id = id;
            SaveManager.Instance.Load(cc, id);
            return((T)(System.Object)cc);
        }
 void OnDesable()
 {
     collector = null;
 }
 void OnEnable()
 {
     Debug.Assert(PlanetUI.Instance.CurrentBuilding.GetName().Equals("ResourceCollector"));
     collector = (ResourceCollector)PlanetUI.Instance.CurrentBuilding;
 }