本文整理汇总了C#中PartModule.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PartModule.ToString方法的具体用法?C# PartModule.ToString怎么用?C# PartModule.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartModule
的用法示例。
在下文中一共展示了PartModule.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnStart
//rect initialized here
public override void OnStart(PartModule.StartState state)
{
base.OnStart(state);
if(state.Equals(PartModule.StartState.Editor)) return;//don't start anything in the editor
if (state.Equals(PartModule.StartState.PreLaunch)) return;//I think starting in prelaunch will fuck things up. Not sure though.
print("initialising progCom..."+state.ToString());
if ((windowPos.x == 0) && (windowPos.y == 0))//windowPos is used to position the GUI window, lets set it in the center of the screen
{
windowPos = new Rect(Screen.width / 2, Screen.height / 2, 100, 100);
}
init();
//vessel.OnFlyByWire += new FlightInputCallback(performManouvers);
//RenderingManager.AddToPostDrawQueue(3, new Callback(drawGUI));//start the GUI
onFlightStart();
print("Hello, World!");
consoleWrite("Computer online!");
}
示例2: OnStart
public override void OnStart(PartModule.StartState state)
{
print("StartState: " + state.ToString());
base.OnStart(state);
centerTransform = this.part.FindModelTransform("model");
if(state != StartState.Editor)
{
MagnetStatusName = (isMagnetOn ? "On" : "Off");
if (isMagnetOn)
this.part.force_activate();
else
this.part.deactivate();
}
if (!eventsAdded)
{
GameEvents.onVesselRecoveryProcessing.Add(OnVesselRecoveryProcessing);
}
#region fact finding
//list transforms
//var transforms = this.GetComponents<Transform>();
// WARNING: this reutrns NULL
//centerTransform = this.part.FindModelTransform("MagneticDockingRing");
//centerTransform = this.part.FindModelTransform("launchAccelerator1");
//if (centerTransform != null)
//{
// // only returns the "model" transform itself
// //centerTransform.GetComponents<Transform>()
// print("model Transform .GetComponentsInChildren<Transform>()...");
// foreach (var transform in centerTransform.GetComponentsInChildren<Transform>())
// {
// //model
// //Aaron/Parts/MagneticDockingRing/model(Clone)
// //launchAccelerator1
// //Cube
// //Cylinder
// //Cylinder_001
// //Torus
// // Torus_001 - Torus_010
// //LoadingPoint
// printTransform(transform);
// print(transform.position == null ? "null" : "non-null");
// print(transform.root == null ? "null root" : "non-null root");
// }
//}
#endregion
}
示例3: OnStart
public override void OnStart(PartModule.StartState state)
{
print("StartState: " + state.ToString());
base.OnStart(state);
if(state != StartState.Editor)
{
//MagnetStatusName = (isMagnetOn ? "On" : "Off");
}
}
示例4: OnStart
public override void OnStart(PartModule.StartState state)
{
UnityEngine.Debug.Log("[KSPI] - InterstellarResourceScienceModule - OnStart " + state.ToString());
//this.Events["Deploy"].guiActive = false;
Events["activateGenerator"].guiName = generatorActivateName;
Events["deActivateGenerator"].guiName = generatorDeactivateName;
if (generatorActive)
PlayAnimation("Deploy", false, true, false);
else
PlayAnimation("Deploy", true, true, false);
base.OnStart(state);
// calcualte time past since last frame
if (generatorActive && last_active_time > 0)
{
double time_diff = Planetarium.GetUniversalTime() - last_active_time;
var minutes = time_diff / 60;
UnityEngine.Debug.Log("[KSPI] - InterstellarResourceScienceModule - time difference " + minutes + " minutes");
ScreenMessages.PostScreenMessage("Generated Science Data for " + minutes.ToString("0.00") + " minutes", 5.0f, ScreenMessageStyle.LOWER_CENTER);
GenerateScience(time_diff, true);
}
}