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


C# StartState类代码示例

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


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

示例1: OnStart

        public override void OnStart(StartState state)
        {
            if (!String.IsNullOrEmpty(Pivot1Name) && !String.IsNullOrEmpty(Pivot2Name)) {
                ForceTransform = part.FindModelTransform(Pivot2Name);
                BreakTransform = part.FindModelTransform(Pivot1Name);
            } else {
                RTUtil.Log("ModuleRTAntennaAnimated: Pivot error");
                enabled = false;
                return;
            }

            if (IsRTBroken) {
                TrackingMode = TrackingModes.Broken;
            }

            base.OnStart(state);

            if (RTCore.Instance != null) {
                mPivot1 = new Pivot(BreakTransform, Pivot1Speed, Pivot1Range);
                mPivot2 = new Pivot(ForceTransform, Pivot2Speed, Pivot2Range);

                if (IsRTActive) {
                    TrackingMode = TrackingModes.Tracking;
                    mPivot1.SnapToTarget(new DynamicTarget(RTAntennaTargetGuid));
                    mPivot2.SnapToTarget(new DynamicTarget(RTAntennaTargetGuid));
                }
            }
        }
开发者ID:sidfu,项目名称:RemoteTechExtended,代码行数:28,代码来源:ModuleRTAntennaTracking.cs

示例2: OnStart

        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            loadValuesFromConfig();

            //Parse planet efficiencies
            string[] efficiencies = planetEfficiencies.Split(new char[] { ';' });
            string[] efficiencyID;

            foreach (string efficiency in efficiencies)
            {
                efficiencyID = efficiency.Split(new char[] { ',' });

                efficiencyModifiers.Add(int.Parse(efficiencyID[0]), float.Parse(efficiencyID[1]));
            }

            //Now set the efficiency based upon planet.
            int planetID = this.part.vessel.mainBody.flightGlobalsIndex;
            if (efficiencyModifiers.ContainsKey(planetID))
            {
                this.Efficiency = efficiencyModifiers[planetID];
            }

            efficiencyString = "Geothermal Efficiency";
        }
开发者ID:Bear67,项目名称:Pathfinder,代码行数:26,代码来源:WBIGeoThermalPlant.cs

示例3: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart (state);
     parseTransformData();
     findTransforms();
     updateGuiData();
 }
开发者ID:Kerbas-ad-astra,项目名称:SSTULabs,代码行数:7,代码来源:SSTUSolarPanelStatic.cs

示例4: OnStart

        //the part that is enabled and disabled
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            string[] transformGroupNames = transormNames.Split(',');
            models = new List<ModelTransforms>();

            //----------------------------------------------------------
            //create the list of transforms to be made switchable
            //----------------------------------------------------------

            foreach (string transformName in transformGroupNames)
            {
                name = transformName.Trim();

                List<Transform> transforms = new List<Transform>();
                transforms.AddRange(part.FindModelTransforms(name));

                ModelTransforms mt = new ModelTransforms();
                mt.transforms = new List<Transform>();
                mt.transforms.AddRange(transforms);

                models.Add(mt);
            }

            if (!HighLogic.LoadedSceneIsEditor)
            {
                Events["toggleModel"].guiActive = false;
            }
            updateActiveModel();
        }
开发者ID:Raptor831,项目名称:KerbalPlanetaryBaseSystems,代码行数:32,代码来源:ModuleKPBSModelSwitch.cs

示例5: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     base.Startup();
     if (Failed)
         DoFailure();
 }
开发者ID:KSP-RO,项目名称:TestFlight,代码行数:7,代码来源:TestFlightFailure_ReducedMaxThrust.cs

示例6: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart (state);
     if (state != StartState.Editor) {
         RenderingManager.AddToPostDrawQueue (0, OnGUI);
     }
 }
开发者ID:careo,项目名称:SimpleKSPPlugin,代码行数:7,代码来源:SimplePartPlugin.cs

示例7: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     if (state == StartState.Editor || state == StartState.None) return;
     KAS_Shared.createFXSound(this.part, fxSndAttach, attachSndPath, false);
     KAS_Shared.createFXSound(this.part, fxSndDetach, detachSndPath, false);
 }
开发者ID:ErzengelLichtes,项目名称:KAS,代码行数:7,代码来源:KASModuleSuctionCup.cs

示例8: OnStart

        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            if (HighLogic.LoadedSceneIsFlight == false)
            {
                setupExperimentGUI();
                return;
            }

            //Get drill animation
            drillAnimation = this.part.FindModuleImplementing<ModuleAnimationGroup>();

            //Harvester
            harvester = this.part.FindModuleImplementing<ModuleResourceHarvester>();

            //Core sample state
            coreSampleState = CoreSampleStates.Ready;

            //If the biome has been unlocked yet then get the samples left
            if (situationIsValid() && Utils.IsBiomeUnlocked(this.part.vessel))
                coreSampleStatus = getSamplesLeft().ToString();
            else
                coreSampleStatus = kUnknown;

            //Setup the gui
            setupGUI();
        }
开发者ID:PalverZ,项目名称:Pathfinder,代码行数:28,代码来源:WBIModuleCoreSample.cs

示例9: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart (state);
     initResource ();									//find ablator resource in part
     initMeshes ();										//load mesh from mesh names specified in config
     updateHeatShieldColor ();							//update heat-shield color to appropriate color from stored ablator amount
 }
开发者ID:Kerbas-ad-astra,项目名称:SSTULabs,代码行数:7,代码来源:SSTUAblator.cs

示例10: OnStart

 public override void OnStart(StartState state)
 {
     if (state == StartState.Editor && !spawned) {
         currentState = initialState;
     } else {
         part.CrewCapacity = currentState ? capacityWhenTrue : capacityWhenFalse;
         if (vessel.situation == Vessel.Situations.PRELAUNCH) {
             int difference = part.protoModuleCrew.Count - part.CrewCapacity;
             if (difference > 0) {
                 JUtil.LogMessage (this, "Stowaways found in part {0}", part.partName);
             }
             var stowaways = new List<ProtoCrewMember> ();
             // We go through the list backwards, assuming that the 'more important' seats are first in the list of seats.
             for (int i = part.protoModuleCrew.Count - 1; i >= 0; i--) {
                 if (difference > 0) {
                     stowaways.Add (part.protoModuleCrew [i]);
                     difference--;
                 } else {
                     break;
                 }
             }
             foreach (ProtoCrewMember stowaway in stowaways) {
                 part.RemoveCrewmember (stowaway);
                 stowaway.seat = null;
                 stowaway.rosterStatus = ProtoCrewMember.RosterStatus.Available;
             }
             JUtil.LogMessage (this, "{0} stowaways evicted.", stowaways.Count);
         }
         // And then make sure the seat flags are correct.
         AlterCrewCapacity (part);
         if (vessel.isActiveVessel)
             GameEvents.onVesselChange.Fire (vessel);
     }
     spawned = true;
 }
开发者ID:Kerbas-ad-astra,项目名称:PartUtilities,代码行数:35,代码来源:JSICrewCapacityManager.cs

示例11: OnStart

        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            //Grab the survey module
            orbitalSurveyer = this.part.FindModuleImplementing<ModuleOrbitalSurveyor>();
            orbitalScanner = this.part.FindModuleImplementing<ModuleOrbitalScanner>();

            //Verify that the planet is really unlocked
            verifyPlanetUnlock();

            //Hide stock survey GUI
            if (orbitalSurveyer != null)
            {
                orbitalSurveyer.Events["PerformSurvey"].guiActive = false;
                orbitalSurveyer.Events["PerformSurvey"].guiActiveUnfocused = false;
                orbitalSurveyer.Events["PerformSurvey"].guiActiveEditor = false;
            }

            //Create swizzler
            swizzler = new WBIResultsDialogSwizzler();
            swizzler.onTransmit = transmitData;

            //Setup the science container
            scienceContainer = this.part.FindModuleImplementing<ModuleScienceContainer>();
            scienceContainer.Events["ReviewDataEvent"].guiActiveUnfocused = false;
            scienceContainer.Events["ReviewDataEvent"].guiActive = false;

            //Now setup our own GUI
            botchedResultsMsg = kSafeMode;
            SetupGUI();
        }
开发者ID:Bear67,项目名称:Pathfinder,代码行数:32,代码来源:GeoSurveyCamera.cs

示例12: OnStart

        //set the names of the actions
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            Events["changeRate"].guiName = changeRateString;
            Fields["guiProductionRate"].guiName = converterRateName;
        }
开发者ID:Raptor831,项目名称:KerbalPlanetaryBaseSystems,代码行数:8,代码来源:ModuleKPBSConverter.cs

示例13: OnStart

		/* SAT: KSP entry points */
		public override void OnStart ( StartState state )
        {
			if (state == StartState.Editor)
            {
				print ("[SCANsat] start: in editor");
				Events["editorExtend"].active = !string.IsNullOrEmpty(animationName);
            } else
            {
				print ("[SCANsat] start: live");
            }
			if (animationName != null)
            {
				Animation[] a = part.FindModelAnimators (animationName);
				if (a.Length == 0)
                {
					print ("[SCANsat] animation '" + animationName + "' not found");
                } else
                {
					print ("[SCANsat] using animation #1 out of " + a.Length.ToString () + " animations named '" + animationName + "'");
					anim = a [0];
					// maybe use this later for advanced animation...
					Transform modeltransform = part.transform.FindChild ("model");
					foreach (Transform t in modeltransform.GetComponentsInChildren<Transform>())
                    {
						//print("[SCANsat] transform " + t.name + ": " + t);
                    }
                }
            }
			print ("[SCANsat] sensorType: " + sensorType.ToString () + " fov: " + fov.ToString () + " min_alt: " + min_alt.ToString () + " max_alt: " + max_alt.ToString () + " best_alt: " + best_alt.ToString () + " power: " + power.ToString ());
        }
开发者ID:BobPalmer,项目名称:SCANsat,代码行数:31,代码来源:SCANsat.cs

示例14: OnStart

 public override void OnStart(StartState state)
 {
     base.OnStart(state);
     _basePitchTorque = PitchTorque;
     _baseYawTorque = YawTorque;
     _baseRollTorque = RollTorque;
 }
开发者ID:Kerbas-ad-astra,项目名称:TarsierSpaceTechnology,代码行数:7,代码来源:TSTGyroReactionWheel.cs

示例15: OnStart

        public override void OnStart(StartState state)
        {
            // parent OnStart
            base.OnStart(state);

            module = Utils.getModuleByType<ModuleReactionWheel>(base.part);
        }
开发者ID:MartynasStropa,项目名称:KSP_rusty,代码行数:7,代码来源:usageReactionWheels.cs


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