diff --git a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/BasicInterval.cs b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/BasicInterval.cs index 5e9b11bb..e3239045 100644 --- a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/BasicInterval.cs +++ b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/BasicInterval.cs @@ -90,18 +90,19 @@ protected override void Awake () defaultPosMarker = lineRenderers [4]; } - - mainLine.SetVertexCount (2); - endPoint1.SetVertexCount(2); - endPoint2.SetVertexCount(2); - currentPosMarker.SetVertexCount(2); - defaultPosMarker.SetVertexCount(2); + mainLine.positionCount = 2; + endPoint1.positionCount = 2; + endPoint2.positionCount = 2; + + currentPosMarker.positionCount = 2; + defaultPosMarker.positionCount = 2; } public void SetMainLineColors(Color startColor, Color endColor) { - mainLine.SetColors(startColor, endColor); + mainLine.startColor = startColor; + mainLine.endColor = endColor; } public void SetPresetPositions(List newList) @@ -121,8 +122,12 @@ public void SetPresetPositions(List newList) var posRenderer = CreateNewRenderer(); posRenderer.material = material; presetsPosMarkers.Add(posRenderer); - posRenderer.SetVertexCount(2); - posRenderer.SetColors(presetPositionsColor, presetPositionsColor); + posRenderer.positionCount = 2; + //posRenderer.positionCount = 2; + posRenderer.startColor = presetPositionsColor; + posRenderer.endColor = presetPositionsColor; + //posRenderer.startColor = presetPositionsColor; + //posRenderer.endColor = presetPositionsColor; posRenderer.gameObject.layer = gameObject.layer; } } @@ -152,36 +157,44 @@ protected override void LateUpdate () endPoint1.SetPosition (0, mainStartPoint + cross * width * 2); endPoint1.SetPosition (1, mainStartPoint - cross * width * 2); - endPoint1.SetColors(endPoint1Color, endPoint1Color); + endPoint1.startColor = endPoint1Color; + endPoint1.endColor = endPoint1Color; endPoint2.SetPosition (0, mainEndPoint + cross * width * 2); endPoint2.SetPosition (1, mainEndPoint - cross * width * 2); - endPoint2.SetColors(endPoint2Color, endPoint2Color); + endPoint2.startColor = endPoint2Color; + endPoint2.endColor = endPoint2Color; - currentPosMarker.SetWidth (width*2, 0.01f); + currentPosMarker.startWidth = width*2; + currentPosMarker.endWidth = 0.01f; - currentPosMarker.SetColors(currentPositionColor, currentPositionColor); + currentPosMarker.startColor = currentPositionColor; + currentPosMarker.endColor = currentPositionColor; currentPosMarker.SetPosition (0, currentPosPoint - cross * width * 2); currentPosMarker.SetPosition (1, currentPosPoint); - defaultPosMarker.SetWidth (width*2, 0.01f); + defaultPosMarker.startWidth = width*2; + defaultPosMarker.endWidth = 0.01f; defaultPosMarker.SetPosition (0, defaultPosPoint + cross * width * 2); defaultPosMarker.SetPosition (1, defaultPosPoint); - defaultPosMarker.SetColors(endPoint1Color, endPoint1Color); + defaultPosMarker.startColor = endPoint1Color; + defaultPosMarker.endColor = endPoint1Color; for (int i = 0; i < presetsPosMarkers.Count; i++) { var pos = presetPositions[i]; var posMarker = presetsPosMarkers[i]; var posPoint = transform.position + norm * pos; - posMarker.SetWidth(width * 0.5f, width * 0.5f); + posMarker.startWidth = width * 0.5f; + posMarker.endWidth = width * 0.5f; posMarker.SetPosition(0, posPoint - cross * width * 2.5f); posMarker.SetPosition(1, posPoint); - posMarker.SetColors(presetPositionsColor, presetPositionsColor); + posMarker.startColor = presetPositionsColor; + posMarker.endColor = presetPositionsColor; } } } diff --git a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/CircularInterval.cs b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/CircularInterval.cs index 2f0c6f50..df737116 100644 --- a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/CircularInterval.cs +++ b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/CircularInterval.cs @@ -17,32 +17,38 @@ protected override void Start () { base.Start (); - mainLine.SetVertexCount(vertexCount); + mainLine.positionCount = vertexCount; mainLine.useWorldSpace = false; - mainLine.SetColors(lineColor, lineColor); + mainLine.startColor = lineColor; + mainLine.endColor = lineColor; - endPoint1.SetVertexCount(2); + endPoint1.positionCount = 2; endPoint1.useWorldSpace = false; - endPoint1.SetColors(lineColor, lineColor); + endPoint1.startColor = lineColor; + endPoint1.endColor = lineColor; - endPoint2.SetVertexCount(2); + endPoint2.positionCount = 2; endPoint2.useWorldSpace = false; - endPoint2.SetColors(lineColor, lineColor); + endPoint2.startColor = lineColor; + endPoint2.endColor = lineColor; - currentPosMarker.SetVertexCount(2); + currentPosMarker.positionCount = 2; currentPosMarker.useWorldSpace = false; - currentPosMarker.SetColors(lineColor, lineColor); + currentPosMarker.startColor = lineColor; + currentPosMarker.endColor = lineColor; - defaultPosMarker.SetVertexCount(2); + defaultPosMarker.positionCount = 2; defaultPosMarker.useWorldSpace = false; - defaultPosMarker.SetColors(lineColor, lineColor); + defaultPosMarker.startColor = lineColor; + defaultPosMarker.endColor = lineColor; for (int i = 0; i < presetsPosMarkers.Count; i++) { var posRenderer = presetsPosMarkers[i]; posRenderer.useWorldSpace = false; - posRenderer.SetVertexCount(2); - posRenderer.SetColors(presetPositionsColor, presetPositionsColor); + posRenderer.positionCount = 2; + posRenderer.startColor = presetPositionsColor; + posRenderer.endColor = presetPositionsColor; posRenderer.gameObject.layer = gameObject.layer; } @@ -86,11 +92,15 @@ protected override void LateUpdate () if (arcAngle < 360) { - endPoint1.SetWidth (width, width); - endPoint2.SetWidth (width, width); + endPoint1.startWidth = width; + endPoint1.endWidth = width; + endPoint2.startWidth = width; + endPoint2.endWidth = width; - endPoint1.SetColors(endPoint1Color, endPoint1Color); - endPoint2.SetColors(endPoint2Color, endPoint2Color); + endPoint1.startColor = endPoint1Color; + endPoint1.endColor = endPoint1Color; + endPoint2.startColor = endPoint2Color; + endPoint2.endColor = endPoint2Color; a = Mathf.Deg2Rad * (offsetAngle); x = Mathf.Sin (a) * (circleRadius - width*2); @@ -117,8 +127,10 @@ protected override void LateUpdate () //now draw the currentPosition marker - currentPosMarker.SetColors (currentPositionColor, currentPositionColor); - currentPosMarker.SetWidth (width*2, 0.01f); + currentPosMarker.startColor = currentPositionColor; + currentPosMarker.endColor = currentPositionColor; + currentPosMarker.startWidth = width*2; + currentPosMarker.endWidth = 0.01f; a = Mathf.Deg2Rad * currentPosition; x = Mathf.Sin (a) * (circleRadius - width*2); @@ -131,8 +143,10 @@ protected override void LateUpdate () v = new Vector3(x, y, z); currentPosMarker.SetPosition(1, v); - defaultPosMarker.SetWidth (width*2, 0.01f); - defaultPosMarker.SetColors(endPoint1Color, endPoint1Color); + defaultPosMarker.startWidth = width*2; + defaultPosMarker.endWidth = 0.01f; + defaultPosMarker.startColor = endPoint1Color; + defaultPosMarker.endColor = endPoint1Color; a = Mathf.Deg2Rad * defaultPosition; x = Mathf.Sin (a) * (circleRadius + width*2); @@ -151,8 +165,10 @@ protected override void LateUpdate () posMarker.useWorldSpace = false; var pos = presetPositions[i]; - posMarker.SetColors(presetPositionsColor, presetPositionsColor); - posMarker.SetWidth(width * 0.5f, width * 0.5f); + posMarker.startColor = presetPositionsColor; + posMarker.endColor = presetPositionsColor; + posMarker.startWidth = width * 0.5f; + posMarker.endWidth = width * 0.5f; a = Mathf.Deg2Rad * pos; x = Mathf.Sin(a) * (circleRadius + width * 2.5f); diff --git a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/LinePrimitive.cs b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/LinePrimitive.cs index e8642519..710a660c 100644 --- a/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/LinePrimitive.cs +++ b/InfernalRobotics/InfernalRobotics/Gui/IRBuildAid/LinePrimitive.cs @@ -27,7 +27,8 @@ public virtual void UpdateColor (Color newColor) lineColor = newColor; foreach(var lr in lineRenderers) { - lr.SetColors (newColor, newColor); + lr.startColor = newColor; + lr.endColor = newColor; } } @@ -35,7 +36,8 @@ public virtual void UpdateWidth(float v1, float v2) { foreach(var lr in lineRenderers) { - lr.SetWidth (v1, v2); + lr.startWidth = v1; + lr.endWidth = v2; } } diff --git a/InfernalRobotics/InfernalRobotics/Gui/UIAssetsLoader.cs b/InfernalRobotics/InfernalRobotics/Gui/UIAssetsLoader.cs index 8548e2ef..25610334 100644 --- a/InfernalRobotics/InfernalRobotics/Gui/UIAssetsLoader.cs +++ b/InfernalRobotics/InfernalRobotics/Gui/UIAssetsLoader.cs @@ -166,7 +166,7 @@ public void Start() Logger.Log("Loading bundles from BundlePath: " + bundlePath, Logger.Level.Debug); //need to clean cache - Caching.CleanCache(); + Caching.ClearCache(); StartCoroutine(LoadBundle(bundlePath + "ir_ui_objects.bundle")); diff --git a/InfernalRobotics/InfernalRobotics/Gui/WindowManager.cs b/InfernalRobotics/InfernalRobotics/Gui/WindowManager.cs index 04080355..3699111f 100644 --- a/InfernalRobotics/InfernalRobotics/Gui/WindowManager.cs +++ b/InfernalRobotics/InfernalRobotics/Gui/WindowManager.cs @@ -1621,11 +1621,12 @@ public void ShowIRWindow() if(HighLogic.LoadedSceneIsEditor || guiFlightEditorWindowOpen) { - _editorWindowFader.FadeTo(_UIAlphaValue, 0.1f, () => { GUIEnabled = true; appLauncherButton.SetTrue(false); }); + if(_editorWindowFader != null) + _editorWindowFader.FadeTo(_UIAlphaValue, 0.1f, () => { GUIEnabled = true; appLauncherButton.SetTrue(false); }); } - else + else if(_controlWindowFader != null) { - _controlWindowFader.FadeTo(_UIAlphaValue, 0.1f, () => { GUIEnabled = true; appLauncherButton.SetTrue(false); }); + _controlWindowFader.FadeTo(_UIAlphaValue, 0.1f, () => { GUIEnabled = true; appLauncherButton.SetTrue(false); }); } } diff --git a/InfernalRobotics/InfernalRobotics/Module/ModuleIRServo.cs b/InfernalRobotics/InfernalRobotics/Module/ModuleIRServo.cs index ef1b1351..86736adf 100644 --- a/InfernalRobotics/InfernalRobotics/Module/ModuleIRServo.cs +++ b/InfernalRobotics/InfernalRobotics/Module/ModuleIRServo.cs @@ -722,8 +722,8 @@ protected virtual void BuildAttachments() /// protected void FindTransforms() { - ModelTransform = part.transform.FindChild("model"); - RotateModelTransform = ModelTransform.FindChild(rotateModel); + ModelTransform = part.transform.Find("model"); + RotateModelTransform = ModelTransform.Find(rotateModel); FixedMeshTransform = KSPUtil.FindInPartModel(transform, fixedMesh); }