unity 便捷创建.asset文件进行资源拖拽的创建工具
使用方法:
1 创建需要存储的类 比如:
using UnityEngine;
using System;
[Serializable]
public class PrefabAsset : MyBaseAsset
{
public GameObject prefab;
public string prefabName;
}
2 进入unity 点击mytools/CreatAsset 弹出创建窗口
3 把刚才创建的脚本拖进去 点击creat 即可创建.asset文件
4 在里边拖东西进去
5 使用
代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Example : MonoBehaviour
{
public PrefabAsset asset;
// Start is called before the first frame update
void Start()
{
Instantiate(asset.prefab);
}
// Update is called once per frame
void Update()
{
}
}
csdn下载需要收费好像 所以丢大鸟转转hub了
文件地址:https://github.com/zlygithub-98/CreatAssetTool
制作;小果冻