Browse Source

cleaned up test code

master
Youen Toupin 9 years ago
parent
commit
18b434b73c
  1. 14
      Plugin/ModuleBalloonCase.cs

14
Plugin/ModuleBalloonCase.cs

@ -98,23 +98,11 @@ namespace Aerostats
UnityEngine.Debug.Log("Aerostats: staged");
Util.PostDebugScreenMessage("staged");
/*var balloonObject = GameObject.CreatePrimitive(PrimitiveType.Sphere);
balloonObject.SetActive(false);
balloonObject.transform.position = part.Rigidbody.position + part.Rigidbody.transform.up;
var balloonPart = balloonObject.AddComponent<Part>();
balloonPart.children = new List<Part>();
balloonPart.partTransform = balloonObject.transform;
balloonPart.name = "heliumBalloon";
new GameObject("model").transform.parent = balloonPart.partTransform;
balloonPart.SetHierarchyRoot(balloonPart);
balloonPart.vessel = vessel;
balloonPart.setParent(part);*/
AvailablePart avPart = PartLoader.Instance.parts.Single(p => p.name == "heliumBalloon");
var balloonPart = (Part)UnityEngine.Object.Instantiate(avPart.partPrefab);
var balloonObject = balloonPart.gameObject;
balloonObject.transform.position = part.Rigidbody.position + part.Rigidbody.transform.up * 3.0f;
//balloonObject.transform.rotation = part.Rigidbody.rotation;
balloonObject.transform.rotation = part.Rigidbody.rotation;
balloonPart.SetHierarchyRoot(balloonPart);
balloonPart.vessel = vessel;
balloonPart.setParent(part);

Loading…
Cancel
Save