public static void ShowErrorBox(GameObject sender, string message) { string name = sender.Name == null || sender.Name.Length == 0 ? "" : " (" + sender.Name + ")"; MessageBox.Show(message, "Editor error - " + sender.GetType().Name + name, MessageBoxButtons.OK, MessageBoxIcon.Information); }
// static methods public static GameElement WhoIsIt(GameObject go) { Type go_type = go.GetType(); if (typeof(MainGameObject).IsAssignableFrom(go_type)) return GameElement.MGO; else if (typeof(Enemy).IsAssignableFrom(go_type)) return GameElement.Enemy; else if (typeof(MovingElement).IsAssignableFrom(go_type)) return GameElement.MovingElement; else return GameElement.Unknown; }