Git Product home page Git Product logo

unitybuildmechine's Introduction

example

Custom Actions

public class BuildAction_CustomAction : BuildAction
{
    // 字段的数值会被保存 
    public string Msg;

    // 属性的数值不会被保存。非常可能丢失
    public string Msg {get; set;}

    public BuildAction_CustomAction(string msg)
    {
        this.Msg = msg;
    }

    public override BuildState OnUpdate()
    {
        Debug.Log(Msg);
        
        // 状态被设置成Success后,一下次tick会进入下一个任务
        return BuildState.Success;

        // 状态被设置成Failure后,一下次tick会结束任务队列
        // return BuildState.Failure;
    }

    public override BuildProgress GetProgress()
    {
        // 返回空不现实进度条
        return null;

        // 返回具体参数现实进度条
    }
}

BatchModeExample

// cmd
"x:\x\Unity.exe" -projectpath "x:\Project" -executeMethod BuildMechineExample.Build -batchmode

C#代码中使用BuildMechine.Run(true)而不是BuildMechine.Rune(false)

注意事项

  • 内部使用 UnityEngine.JsonUtility。如果自定义BuildAction里边使用Properties和JsonUtility不兼容的List或者Dictionary或者Array。会导致Action的数据丢失。

unitybuildmechine's People

Contributors

oyji1992 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.