public void AddBuildModule(AbstractBuildConfig config, bool calculate = false)
        {
            if (config == null)
            {
                return;
            }

            buildModules.Add(config);
            config.App(uid, this, calculate);

            switch (config.buildModuleType)
            {
            case BuildModuleType.Produce:
                lastBuildProduceConfig = (BuildProduceConfig)config;
                build_produce          = true;
                break;

            case BuildModuleType.Turret:
                lastBuildTurretConfig = (BuildTurretConfig)config;
                build_turret          = true;
                break;

            case BuildModuleType.Spot:
                lastBuildSpotConfig = (BuildSpotConfig)config;
                build_spot          = true;
                break;
            }
        }
        /** 附加建筑功能 */
        public void BuildAttachModule(AbstractBuildConfig config)
        {
            StopBuildAttachModule();

            attachModuleCallHandler = gameObject.AddComponent <BBuildChangeCallHandler>();
            attachModuleCallHandler.Play(changeTime, effect, OnBuildAttachModule, config);
            SetBuildChangeTime(changeTime);
        }
        public void RemoveBuildModule(AbstractBuildConfig config, bool calculate = false)
        {
            if (config == null)
            {
                return;
            }

            buildModules.Remove(config);
            config.Revoke(uid, this, calculate);

            switch (config.buildModuleType)
            {
            case BuildModuleType.Produce:
                if (lastBuildProduceConfig == config)
                {
                    lastBuildProduceConfig = null;
                    build_produce          = false;
                }
                break;

            case BuildModuleType.Turret:
                if (lastBuildTurretConfig == config)
                {
                    lastBuildTurretConfig = null;
                    build_turret          = false;
                }
                break;

            case BuildModuleType.Spot:
                if (lastBuildSpotConfig == config)
                {
                    lastBuildSpotConfig = null;
                    build_spot          = false;
                }
                break;
            }
        }
Beispiel #4
0
 public void BuildAttachModule(AbstractBuildConfig config)
 {
     buildChangeManager.BuildAttachModule(config);
 }
 public void BuildAttachModule(AbstractBuildConfig config)
 {
     AddBuildModule(config);
     this.Props.Calculate();
 }