public static void Make(GameObject body) { GameObject RFVolume = new GameObject(); RFVolume.name = "RFVolume"; RFVolume.transform.parent = body.transform; RFVolume.layer = 19; RFVolume.SetActive(false); SphereCollider RF_SC = RFVolume.AddComponent <SphereCollider>(); RF_SC.isTrigger = true; RF_SC.radius = 600f; ReferenceFrameVolume RF_RFV = RFVolume.AddComponent <ReferenceFrameVolume>(); ReferenceFrame test = new ReferenceFrame(MainClass.OWRB); test.SetValue("_minSuitTargetDistance", 300); test.SetValue("_maxTargetDistance", 0); test.SetValue("_autopilotArrivalDistance", 1000); test.SetValue("_autoAlignmentDistance", 1000); test.SetValue("_hideLandingModePrompt", false); test.SetValue("_matchAngularVelocity", true); test.SetValue("_minMatchAngularVelocityDistance", 70); test.SetValue("_maxMatchAngularVelocityDistance", 400); test.SetValue("_bracketsRadius", 300); RF_RFV.SetValue("_referenceFrame", test); RF_RFV.SetValue("_minColliderRadius", 300); RF_RFV.SetValue("_maxColliderRadius", 2000); RF_RFV.SetValue("_isPrimaryVolume", true); RF_RFV.SetValue("_isCloseRangeVolume", false); RFVolume.SetActive(true); }
public static void Make(GameObject body, OWRigidbody rigidbody, IPlanetConfig config) { GameObject rfGO = new GameObject("RFVolume"); rfGO.transform.parent = body.transform; rfGO.layer = 19; rfGO.SetActive(false); SphereCollider SC = rfGO.AddComponent <SphereCollider>(); SC.isTrigger = true; SC.radius = config.AtmoEndSize * 2; ReferenceFrameVolume RFV = rfGO.AddComponent <ReferenceFrameVolume>(); ReferenceFrame RV = new ReferenceFrame(rigidbody); RV.SetValue("_minSuitTargetDistance", 300); RV.SetValue("_maxTargetDistance", 0); RV.SetValue("_autopilotArrivalDistance", 1000); RV.SetValue("_autoAlignmentDistance", 1000); //Utility.AddDebugShape.AddSphere(rfGO, 1000, new Color32(0, 255, 0, 128)); RV.SetValue("_hideLandingModePrompt", false); RV.SetValue("_matchAngularVelocity", true); RV.SetValue("_minMatchAngularVelocityDistance", 70); RV.SetValue("_maxMatchAngularVelocityDistance", 400); RV.SetValue("_bracketsRadius", 300); RFV.SetValue("_referenceFrame", RV); RFV.SetValue("_minColliderRadius", 300); RFV.SetValue("_maxColliderRadius", config.AtmoEndSize * 2); RFV.SetValue("_isPrimaryVolume", true); RFV.SetValue("_isCloseRangeVolume", false); rfGO.SetActive(true); Logger.Log("Finished building rfvolume", Logger.LogType.Log); }