Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel4

...

Upgrading .unitypackage files is a little more difficult.  This quote from the Unity docs explains it:

"For the cleanest possible upgrade, it should be considered to remove the old package contents first, as some scripts, effects or prefabs might have become deprecated or unneeded and Unity packages don't have a way of deleting (unneeded) files (but make sure to have a security copy of the old version available)."

The easiest way I've found is to use the approach the SVN docs recommend for vendor branch upgrades.

...

Add a new command callback for an arbitrary command 

Code Block
languagecsharp
m_Console.AddCommandCallback("some_command", new DebugConsole.ConsoleCallback(HandleConsoleMessage));

void HandleConsoleMessage(string commandEntered, DebugConsole console)
{
      if (commandEntered.IndexOf("some_command") != -1)
           // Do Something
}

...

  1. Inside the assets folder in your unity project, create a file called BuildSettings.xml
  2. In the same folder as the Assets folder within your Unity project create a .bat file with the following lines

    Infocode
    @setlocal
    
    set PROJECTPATH=%CD%
    
    pushd ..\Unity
    
    call runEditorBatch.bat -projectPath %PROJECTPATH% -batchmode -nographics -quit -executeMethod UnityStartup.PerformWindowsBuild
    
    popd
    
    @endlocal
  3. Use the following template for custom modification

    Infocode
    languagehtml/xml
    <?xml version="1.0" encoding="utf-8"?>

    
    <BuildSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cpandl.com">

      <ExternalAssetsPaths>
       
    
      <ExternalAssetsPaths>
        <string>Assets/SomeDirectory</string>

        <string>Assets
    
        <string>Assets/SomeOtherDirectory</string>

     
    
      </ExternalAssetsPaths>

     
    
      <BuildOutputPath>Builds/YourProject/YourProject.exe</BuildOutputPath>

     
    
      <PostBuildScript>somePostBuildScript.bat</PostBuildScript>

      <ConfigFiles>
       
    
      <ConfigFiles>
        <string>Assets/config.ini</string>

     
    
      </ConfigFiles>

    
    </BuildSettings>

BuildSettings.xml Format

FieldDesrcription
ExternalAssetsPathsArray of folder names that will be copied to the BuildOutputPath. (OPTIONAL)
BuildOutputPath

Path specifying the name and location of the .exe for your build (REQUIRED)

PostBuildScript

A .bat or .exe that will be run after the build process is completed. (OPTIONAL)

ConfigFilesArray of file names taht will be copied to the BuildOutputPath. (OPTIONAL)

...

You can create a config .ini file in your project and read it using the IniParser class

Code Blockinfo
languagecsharp
m_ConfigFile = new IniParser(configFileName);

m_ConfigFile.GetSetting("SomeSetting") // returns a string with the value of that setting, if it exists

Known Issues


FAQ

FAQ