public static void ResetAllCollider()
    {
        GameColliderSet colliderSet = new GameColliderSet();
        var             guids       = AssetDatabase.FindAssets("t:GameObject", new string[] { "Assets/ResourceEx/Prefab" });
        int             count       = guids.Length;

        for (int i = 0; i < count; i++)
        {
            EditorUtility.DisplayProgressBar("更新碰撞框数据", "正在更新碰撞框数据(" + i + "/" + count + ")", i / (float)count);
            string           goPath       = AssetDatabase.GUIDToAssetPath(guids[i]);
            GameObject       gameObject   = AssetDatabase.LoadAssetAtPath <GameObject>(goPath);
            GameColliderView colliderView = gameObject.GetComponent <GameColliderView>();
            if (colliderView != null)
            {
                GameColliderItem colliderItem = new GameColliderItem();
                colliderItem.path = goPath;
                FindCollider(gameObject.transform, gameObject.transform, colliderItem);
                colliderSet.mLstColliderItem.Add(colliderItem);
            }
        }
        NEUtil.SerializerObject(GameColliderCfgSys.GameColliderPath, colliderSet, GameColliderCfgSys.RelateTypes);
        EditorUtility.ClearProgressBar();
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }
示例#2
0
    public static void ResetAllHangPoint()
    {
        HangPointSet hangPointSet = new HangPointSet();
        var          guids        = AssetDatabase.FindAssets("t:GameObject", new string[] { "Assets/ResourceEx/Prefab" });
        int          count        = guids.Length;

        for (int i = 0; i < count; i++)
        {
            EditorUtility.DisplayProgressBar("更新挂点数据", "正在更新挂点数据(" + i + "/" + count + ")", i / (float)count);
            string        goPath        = AssetDatabase.GUIDToAssetPath(guids[i]);
            GameObject    gameObject    = AssetDatabase.LoadAssetAtPath <GameObject>(goPath);
            HangPointView hangPointView = gameObject.GetComponent <HangPointView>();
            if (hangPointView != null)
            {
                HangPointItem hangPointItem = new HangPointItem();
                hangPointItem.path = goPath;
                FindHangPoint(gameObject.transform, gameObject.transform, null, null, hangPointItem);
                hangPointSet.mLstHangPointItem.Add(hangPointItem);
            }
        }
        NEUtil.SerializerObject(HangPointCfgSys.HangPointPath, hangPointSet);
        EditorUtility.ClearProgressBar();
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }
 private void SaveData()
 {
     if (m_cColliderSet == null)
     {
         return;
     }
     NEUtil.SerializerObject(GameColliderCfgSys.GameColliderPath, m_cColliderSet, GameColliderCfgSys.RelateTypes);
 }
示例#4
0
 private void SaveData()
 {
     if (m_cHangPointSet == null)
     {
         return;
     }
     NEUtil.SerializerObject(HangPointCfgSys.HangPointPath, m_cHangPointSet);
 }