|
|
|
@ -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); |
|
|
|
|