Home Unity 自建package包流程
Post
Cancel

Unity 自建package包流程

  1. 创建一个Visual Studio Dll项目
    alt text

  2. 项目路径配置
    alt text alt text
  3. 编译项目 alt text

  4. 添加package.json文件
    1
    2
    3
    4
    5
    6
    7
    
    {
     "name":"com.abenmu.test",
     "displayName":"abenmu",
     "version":"1.0.0",
      "dependencies": {
      }
    } 
    
  5. 编写代码
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
     namespace AbenmuGame
    {
     public class Battle
     {
         public void Add()
         {
    
         }
     }
    }
    
  6. Unity 调用
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
     using AbenmuGame;
    public class Testpackage : MonoBehaviour
    {
     void Start()
     {
         AbenmuGame.Battle a = new Battle();
         a.Add();
     }
    }
    
  7. 调试(使用Rider)
    alt text alt text
This post is licensed under CC BY 4.0 by the author.