public static string GetGroupName(ThingInMemory thing) { if (thing is NativeUnityEngineObject) { return((thing as NativeUnityEngineObject).className ?? "MissingName"); } if (thing is ManagedObject) { return((thing as ManagedObject).typeDescription.name); } return(thing.GetType().Name); }
private Color ColorFor(ThingInMemory rb) { if (rb == null) { return(Color.gray); } if (rb is NativeUnityEngineObject) //Red { return(new Color(0.9568f, 0.2627f, 0.2117f)); } if (rb is ManagedObject) //Blue { return(new Color(0.1294f, 0.5882f, 0.9529f)); } if (rb is GCHandle) { return(new Color(0.5411f, 0.7607f, 0.2862f)); //Green } if (rb is StaticFields) { return(new Color(1, 0.9215f, 0.2313f)); //Yellow } throw new ArgumentException("Unexpected type: " + rb.GetType()); }