zoukankan      html  css  js  c++  java
  • unity编辑器扩展_05(删除游戏对象并具有撤回功能)

    代码:

      [MenuItem("Tools/Delete",false,1)]
        static void Delete()
        {
            GameObject[] go = Selection.gameObjects;
            foreach (GameObject g in go)
            {
                //GameObject.DestroyImmediate(g);
                Undo.DestroyObjectImmediate(g);
            }   
        }

    注意:如果使用注释语句删除游戏对象,则不能撤回,不推荐使用。

              Undo使得具有撤回功能,Ctrl+z(系统默认的撤回操作)

  • 相关阅读:
    事务的隔离级别
    事务的隔离
    事务简介
    leetcode647
    leetcode394
    leetcode96
    leetcode814
    leetcode738
    leetcode621
    leetcode763
  • 原文地址:https://www.cnblogs.com/shirln/p/7843238.html
Copyright © 2011-2022 走看看