Ejemplo n.º 1
0
        private static void AddAddressGroup(AssetPackerConfig assetPackerConfig)
        {
            if (assetPackerConfig != null)
            {
                RemoveAddressGroup(assetPackerConfig);

                string[] assetPaths = AssetDatabaseUtility.FindAssets <AssetAddressConfig>();
                if (assetPaths == null || assetPaths.Length == 0)
                {
                    Debug.LogError("AssetPackUtil::AddAddressGroup->AssetAddressConfig is not found!");
                    return;
                }

                AssetPackerGroupData groupData = new AssetPackerGroupData()
                {
                    groupName = AddressGroupName,
                };
                AssetPackerAddressData addressData = new AssetPackerAddressData()
                {
                    assetAddress  = AssetConst.ASSET_ADDRESS_CONFIG_NAME,
                    assetPath     = assetPaths[0],
                    bundlePath    = AssetConst.ASSET_ADDRESS_BUNDLE_NAME,
                    bundlePathMd5 = MD5Crypto.Md5(AssetConst.ASSET_ADDRESS_BUNDLE_NAME).ToLower(),
                };
                groupData.assetFiles.Add(addressData);

                assetPackerConfig.groupDatas.Add(groupData);
            }
        }
Ejemplo n.º 2
0
        void OnEnable()
        {
            string[] assetPaths = AssetDatabaseUtility.FindAssets <AvatarCreatorData>();

            dataListView = new EGUIListView <string>
            {
                Header           = "Data List",
                OnSelectedChange = OnListViewItemSelected,
                OnDrawItem       = (rect, index) =>
                {
                    string assetPath = dataListView.GetItem(index);
                    EditorGUI.LabelField(rect, Path.GetFileNameWithoutExtension(assetPath), EGUIStyles.BoldLabelStyle);
                },
            };
            dataListView.AddItems(assetPaths);

            AvatarPartCreatorDataDrawer.CreatePartBtnClick = (data) =>
            {
                CreatePart(data);
            };
            AvatarPartCreatorDataDrawer.PreviewPartBtnClick = (data) =>
            {
                PreviewPart(data);
            };

            previewer = new AvatarPreviewer();
        }
Ejemplo n.º 3
0
        protected virtual void OnEnable()
        {
            fontDataProperty = serializedObject.FindProperty("m_FontData");
            fontNameProperty = serializedObject.FindProperty("m_FontName");
            textProperty     = serializedObject.FindProperty("m_Text");

            string[] fontPaths = AssetDatabaseUtility.FindAssets <BitmapFont>();
            fontDataNames = new string[fontPaths.Length + 1];
            fontDatas     = new BitmapFont[fontPaths.Length + 1];

            fontDataNames[0] = "--None--";
            fontDatas[0]     = null;

            for (int i = 0; i < fontPaths.Length; ++i)
            {
                fontDataNames[i + 1] = Path.GetFileNameWithoutExtension(fontPaths[i]);
                fontDatas[i + 1]     = AssetDatabase.LoadAssetAtPath <BitmapFont>(fontPaths[i]);
            }
        }