当前位置: 首页>>代码示例>>C#>>正文


C# StartState.ToString方法代码示例

本文整理汇总了C#中StartState.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# StartState.ToString方法的具体用法?C# StartState.ToString怎么用?C# StartState.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StartState的用法示例。


在下文中一共展示了StartState.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnStart

        public override void OnStart(StartState state)
        {
            Debug.Log ("Starting KAS_AnimationPlayerModule: " + state.ToString ());

            try
            {
                ReloadAnimations ();
            }
            catch(Exception e)
            {
                Debug.LogException (e);
            }
        }
开发者ID:Kerbas-ad-astra,项目名称:KerbalAnimationSuite,代码行数:13,代码来源:KAS_AnimationPlayerModule.cs

示例2: OnStart

        public override void OnStart(StartState state)
        {
            Debug.Log("ModuleEngineThrustController OnStart(" + state.ToString() + ")");
            m_state = state;

            if (state == StartState.None) return;

            BindEngine();

            if (minimumThrustPercent < 0.0f) minimumThrustPercent = 0.0f;
            if (minimumThrustPercent > 1.0f) minimumThrustPercent = 1.0f;

            if (maximumThrustPercent < 0.0f) maximumThrustPercent = 0.0f;
            if (maximumThrustPercent > 1.0f) maximumThrustPercent = 1.0f;

            if (minimumThrustPercent > maximumThrustPercent) minimumThrustPercent = maximumThrustPercent;

            if (initialThrust < minimumThrustPercent) initialThrust = minimumThrustPercent;
            if (initialThrust > maximumThrustPercent) initialThrust = maximumThrustPercent;

            // Save original engine data.
            if (engine != null)
            {
                originalMaxThrust = engine.maxThrust;
                originalHeatProduction = engine.heatProduction;
                if (((int)state & (int)StartState.PreLaunch) > 0)
                    thrustPercent = initialThrust;
                else if (state == StartState.Editor)
                    thrustPercent = initialThrust;

                engine.maxThrust = originalMaxThrust * thrustPercent;
                engine.heatProduction = originalHeatProduction * thrustPercent;
            }
            else if (engineFX != null)
            {
                originalMaxThrust = engineFX.maxThrust;
                originalHeatProduction = engineFX.heatProduction;
                if (((int)state & (int)StartState.PreLaunch) > 0)
                    thrustPercent = initialThrust;
                else if (state == StartState.Editor)
                    thrustPercent = initialThrust;

                engineFX.maxThrust = originalMaxThrust * thrustPercent;
                engineFX.heatProduction = originalHeatProduction * thrustPercent;
            }
            Debug.Log("Data saved:" + originalMaxThrust.ToString() + " " + thrustPercent.ToString("0%"));

            if (state == StartState.Editor)
            {
                EngineThrustControllerGUI.GetInstance().CheckClear();
                if (showItemInList == true)
                {
                    EngineThrustControllerGUIItem item = new EngineThrustControllerGUIItem(EngineThrustControllerGUI.GetInstance(), this);
                }
                return;
            }
            else
            {
                EngineThrustControllerGUI.GetInstance().ClearGUIItem();
            }

            if (canAdjustAtAnytime == true)
            {
                Events["ContextMenuIncreaseThrust"].guiName = "Increase Thrust by " + percentAdjustmentStep.ToString("0%");
                Events["ContextMenuDecreaseThrust"].guiName = "Decrease Thrust by " + percentAdjustmentStep.ToString("0%");
            }
            else
            {
                Events["ContextMenuIncreaseThrust"].guiActive = false;
                Events["ContextMenuIncreaseThrust"].active = false;
                Events["ContextMenuDecreaseThrust"].guiActive = false;
                Events["ContextMenuDecreaseThrust"].active = false;
            }
            Events["Group1"].guiName = "Set Group 1";
            Events["Group2"].guiName = "Set Group 2";
            Events["Group1"].guiActive = false;
            Events["Group2"].guiActive = false;
            base.OnStart(state);
        }
开发者ID:HoneyFox,项目名称:EngineThrustController,代码行数:79,代码来源:EngineThrustController.cs

示例3: OnStart

        public override void OnStart(StartState state)
        {
            if (Global.Debug2) Utils.Log("state {0}", state.ToString());
            base.OnStart(state);

            // side step serialization issues and use the saved config
            _startState = state;
            if (state == StartState.Editor)
            {
                if (originalConfig == null)
                {
                    if (Global.Debug1) Utils.Log("originalConfig is null");
                }
                else loadConfig(originalConfig);
            }

            if (label != string.Empty) Events["editTextureEvent"].guiName = label;

            _ok = false;
            try
            {
                if (Global.Debug1) Utils.Log("part {0}", this.part.name);

                fillTransformNamesList();
                fillTransformsList();

                if (_transforms == null || _transforms[0] == null)
                {
                    Utils.LogError("No useable transforms, disabling plugin");
                    return;
                }

                findTextures();

                if (_imageModifiers == null) _imageModifiers = new ImageModifiers();
                if (_boundingBox == null) _boundingBox = new BoundingBox();
                if (_baseTexture == null) _baseTexture = new IM.AutoBaseTexture();

                _baseTexture.set(kspTextureInfo);

                if (!_baseTexture.valid)
                {
                    Utils.LogError("invalid base texture trying auto");
                    _baseTexture = new IM.AutoBaseTexture();
                    _baseTexture.set(kspTextureInfo);
                }

                if (_baseTexture.valid)
                {
                    if (_imageModifiers.modifiers.Count > 0) writeTexture();
                    _ok = true;
                }
            }
            catch
            {
                Utils.LogError("Something went wrong in OnStart disabling plugin");
            }
        }
开发者ID:panteras1000,项目名称:TheWriteStuff,代码行数:58,代码来源:ASPTextureEdit.cs

示例4: StartStopUnit

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public CommandStatus StartStopUnit(bool immd, PowerControl pc, StartState state)
        {
            if (m_logger != null)
            {
                string args = immd.ToString() + ", " + pc.ToString() + ", " + state.ToString();
                m_logger.LogMessage(new UserMessage(UserMessage.Category.Debug, 8, "Bwg.Scsi.Device.StartStopUnit(" + args + ")"));
            }

            using (Command cmd = new Command(ScsiCommandCode.StartStopUnit, 6, 0, Command.CmdDirection.None, 30))
            {
                if (immd)
                    cmd.SetCDB8(1, 1) ;

                byte b = (byte)(((byte)pc << 4) | ((byte)state)) ;
                cmd.SetCDB8(4, b) ;

                CommandStatus st = SendCommand(cmd);
                if (st != CommandStatus.Success)
                    return st;
            }
            return CommandStatus.Success; 
        }
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:26,代码来源:Device.cs

示例5: OnStart

        /// <summary>
        /// Start
        /// </summary>
        /// <param name="state"></param>
        public override void OnStart(StartState state)
        {
            GSA.Durability.Debug.Log("GSA Durability: [OnStart][" + state.ToString() + "]: " + this.name);
            base.OnStart(state);
            try
            {
                _state = state;
                AvailablePart currentPartInfo = PartLoader.getPartInfoByName(part.name.Replace("(Clone)", ""));
                _initCost = currentPartInfo.cost;
                if (state == StartState.Editor)
                {
                    return;
                }
                if (part.Resources.Contains("Quality"))
                {
                    quality = (part.Resources["Quality"].amount / (part.Resources["Quality"].maxAmount / 100)) / 100;
                }

                if (basicWear.findCurveMinMaxInterations == 0)
                {
                    basicWear = new FloatCurve();
                    basicWear.Add(0.1f, 0.69f);
                    basicWear.Add(0.5f, 0.000181f);
                    basicWear.Add(1f, 0.00001f);
                }
                _currentWear = basicWear.Evaluate((float)quality);
                _lastUpdateTime = vessel.missionTime;
                _sun = Planetarium.fetch.Sun;
                //gameObject.AddComponent(typeof(LineRenderer));

                if (part.Modules.Contains("ModuleCommand"))
                {
                    _command = (ModuleCommand)part.Modules["ModuleCommand"];
                    GSA.Durability.Debug.Log("GSA Durability: [OnStart]: _command = " + _command.name);
                }

                if (part.Modules.Contains("ModuleReactionWheel"))
                {
                    _reactionWheel = (ModuleReactionWheel)part.Modules["ModuleReactionWheel"];
                    GSA.Durability.Debug.Log("GSA Durability: [OnStart]: _reactionWheel = " + _reactionWheel.name);
                }

                if (part.Modules.Contains("ModuleEngines"))
                {
                    _engine = (ModuleEngines)part.Modules["ModuleEngines"];
                    GSA.Durability.Debug.Log("GSA Durability: [OnStart]: _engine = " + _engine.name);
                }
                if (part.Modules.Contains("ModuleScienceExperiment"))
                {
                    _scienceExperiment = (ModuleScienceExperiment)part.Modules["ModuleScienceExperiment"];
                    GSA.Durability.Debug.Log("GSA Durability: [OnStart]: _scienceExperiment = " + _scienceExperiment.name);
                }

                checkStatus();
                setEventLabel();
            }
            catch (Exception ex)
            {
                GSA.Durability.Debug.LogError("GSA Durability: [OnStart]: Message: " + ex.Message);
                GSA.Durability.Debug.LogError("GSA Durability: [OnStart]: StackTrace: " + ex.StackTrace);
            }

            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: quality:" + quality.ToString());
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: damageRate: " + _currentWear.ToString("0.000000"));
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: vessel.missionTime: " + vessel.missionTime.ToString());
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: lastReduceRange: " + lastReduceRange.ToString());
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: lastUpdateTime: " + _lastUpdateTime.ToString());
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: maxRepair: " + maxRepair.ToString());
            GSA.Durability.Debug.Log("GSA Durability: [OnStart]: canRepair: " + canRepair.ToString());
        }
开发者ID:GermanModProject,项目名称:GSA,代码行数:74,代码来源:DurabilityModule.cs


注:本文中的StartState.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。