Skip to content

Instantly share code, notes, and snippets.

View DMagic1's full-sized avatar

DMagic DMagic1

  • Redwood City, CA
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Text;
using KSP.UI;
using KSP.UI.Dialogs;
using KSP.UI.Screens.DebugToolbar;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.Profiling;
using System.Collections;
using UnityEngine;
namespace JettisonFix
{
[KSPAddon(KSPAddon.Startup.Flight, false)]
public class JettisonFixer : MonoBehaviour
{
private void Awake()
private void DumpGameObjectChilds(GameObject go, string pre, StringBuilder sb)
{
bool first = pre == "";
List<GameObject> neededChilds = new List<GameObject>();
int count = go.transform.childCount;
for (int i = 0; i < count; i++)
{
GameObject child = go.transform.GetChild(i).gameObject;
if (!child.GetComponent<Part>() && child.name != "main camera pivot")
neededChilds.Add(child);
using System.IO;
using UnityEngine;
using Expansions;
namespace MakingLessHistory
{
[KSPAddon(KSPAddon.Startup.Instantly, true)]
public class MakingLessHistory : MonoBehaviour
{
for (int i = 0; i < comp.Length; i++)
{
if (comp[i] == null)
continue;
if (comp[i] is RectTransform)
{
RectTransform rect = (RectTransform)comp[i];
sb.AppendFormat("{0} {1} - {2}\n{0} Anchor Min {3:F0} - Max {4:F0} - Pivot {5}\n{0} Position {6:F0} - Rotation {8:F5} - Size {7:F0}\n"
, preComp, comp[i].GetType().Name, go.transform.name, rect.anchorMin, rect.anchorMax, rect.pivot, rect.anchoredPosition3D, rect.sizeDelta, rect.localRotation.eulerAngles);
Shader: Unlit/Transparent Cutout
Shader: Unlit/Transparent
Shader: Unlit/Color
Shader: UI/Unlit/Text
Shader: UI/KSP/UnlitMeshStencil (+2)
Shader: UI/KSP/UnlitMeshStencil
Shader: UI/KSP/Default (Transparent +2)
Shader: UI/KSP/Color Overlay
Shader: UI/Default Font
Shader: UI/Default
Shader: KSP/Scenery/Decal/Blended
Shader: KSP/BWMixedBumpedSpecular
Shader: KSP/Particles/Alpha Blended
Shader: Legacy Shaders/Bumped Diffuse
Shader: KSP/Scenery/Specular
Shader: KSP/Particles/Additive
Shader: KSP/Scenery/Emissive/Specular
Shader: KSP/Scenery/Bumped
Shader: KSP/Scenery/Emissive/Diffuse
Shader: Particles/Additive