예제 #1
0
 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);
 }
예제 #2
0
        // 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;
        }