public void OnMouseDown() { ScreenMessages.PostScreenMessage("Interacted with collider " + triggerTransform + "!", 1f, ScreenMessageStyle.LOWER_CENTER); if (triggerObject != null) { KerbalIva.HoldItem(triggerObject.transform.parent); } }
public void Start() { CurrentPart = FlightGlobals.ActiveVessel.rootPart; /*sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); * Destroy(sphere.collider); * sphere.layer = 20;*/ IvaKerbal = new KerbalIva(); //Physics.IgnoreLayerCollision(20, 20, false); GuiUtils.DrawGui = true; GuiUtils.SetupGui(); //Utils.line = Utils.CreateLine(Color.white, Color.red, 0.5f, 0.5f); /*forwardLine = CreateLine(Color.white, Color.red, 0.05f, 0.05f); * upLine = CreateLine(Color.white, Color.green, 0.05f, 0.05f); * rightLine = CreateLine(Color.white, Color.blue, 0.05f, 0.05f);*/ Paused = false; GameEvents.onGamePause.Add(new EventVoid.OnEvent(this.OnPause)); GameEvents.onGameUnpause.Add(new EventVoid.OnEvent(this.OnUnPause)); /*screenMessage = new ScreenMessage(string.Empty, 3f, ScreenMessageStyle.UPPER_CENTER); * //screenMessage.message = "Starting Free IVA..."; * ScreenMessages.PostScreenMessage(screenMessage, false);*/ // Per-frame screen message, as used during EVA: //ScreenMessages.PostScreenMessage("[" + GameSettings.EVA_Board.name + "]: Board", 0.1f, ScreenMessageStyle.LOWER_CENTER); Settings.LoadSettings(); OnIvaPartChanged.Add(IvaPartChanged); SetRenderQueues(FlightGlobals.ActiveVessel.rootPart); SetCollisionLayers(); }
public void Start() { CurrentPart = FlightGlobals.ActiveVessel.rootPart; /*sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); Destroy(sphere.collider); sphere.layer = 20;*/ IvaKerbal = new KerbalIva(); //Physics.IgnoreLayerCollision(20, 20, false); GuiUtils.DrawGui = true; GuiUtils.SetupGui(); //Utils.line = Utils.CreateLine(Color.white, Color.red, 0.5f, 0.5f); /*forwardLine = CreateLine(Color.white, Color.red, 0.05f, 0.05f); upLine = CreateLine(Color.white, Color.green, 0.05f, 0.05f); rightLine = CreateLine(Color.white, Color.blue, 0.05f, 0.05f);*/ Paused = false; GameEvents.onGamePause.Add(new EventVoid.OnEvent(this.OnPause)); GameEvents.onGameUnpause.Add(new EventVoid.OnEvent(this.OnUnPause)); /*screenMessage = new ScreenMessage(string.Empty, 3f, ScreenMessageStyle.UPPER_CENTER); //screenMessage.message = "Starting Free IVA..."; ScreenMessages.PostScreenMessage(screenMessage, false);*/ // Per-frame screen message, as used during EVA: //ScreenMessages.PostScreenMessage("[" + GameSettings.EVA_Board.name + "]: Board", 0.1f, ScreenMessageStyle.LOWER_CENTER); Settings.LoadSettings(); OnIvaPartChanged.Add(IvaPartChanged); SetRenderQueues(FlightGlobals.ActiveVessel.rootPart); SetCollisionLayers(); }
public void OnMouseUp() { ScreenMessages.PostScreenMessage("Mouse up from collider " + triggerTransform + "!", 1f, ScreenMessageStyle.LOWER_CENTER); KerbalIva.DropHeldItem(); }