npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@akiojin/unity-command

v1.4.1

Published

A package to control Unity from the command line.

Downloads

98

Readme

unity-command

A package to control Unity from the command line.

Installation

npm install @akiojin/unity-command

Usage

import { Unity, UnityCommandBuilder } from '@akiojin/unity-command'
const builder = new UnityCommandBuilder()
builder
    .SetBuildTarget('iOS')
    .SetExecuteMethod('MyEditorScript.PerformBuild')
    .Append([ '-CustomCommand', 'Param' ])
...
const exe = Unity.GetUnityPath('2021.2.7f1')
execa.execa(exe, builder.Build())

Reference

class UnityUtils

static GetCurrentUnityVersion(projectDirectory: string): string

Description

Returns the Unity version set for the given project.

Arguments

|Name|Type|Description| |:--|:--|:--| |projectDirectory|string|Unity project directory path.|

Return

|Type|Description| |:--|:--| |string|Unity version. (e.g. 2021.2.7f1)|

static GetUnityPath(unityVersion: string): string

Description

Get the path to the Unity editor executable.

Arguments

|Name|Type|Description| |:--|:--|:--| |unityVersion|string|Unity version to be used| |installDirectory|string|Unity installation directory path.|

The installation directory, if omitted, is obtained from the environment variable UNITY_HUB_INSTALL_DIRECTORY. If the environment variable UNITY_HUB_INSTALL_DIRECTORY is not set, it is taken from the default installation directory.

Return

|Type|Description| |:--|:--| |string|Unity app path (e.g. /Applications/Unity/Hub/Editor/2021.2.7f1/Unity.app/Contents/MacOS/Unity)|

class UnityCommandBuilder

The following parameters have already been added by default when the instance is created, so they do not need to be added.

  • -batchmode
  • -silent-crashes

DisableGPUSkinning(): void

Description

Disable Graphics Processing Unit (GPU) skinning at startup.

SetExecuteMethod(executeMethod: string): void

Description

Execute the static method as soon as Unity opens the project, and after the optional Asset server update is complete.

Arguments

|Name|Type|Description| |:--|:--|:--| |executeMethod|string|<ClassName.MethodName> or <NamespaceName.ClassName.MethodName>|

SetJobWorkerCount(count: number): void

Description

Specify the maximum thread count for the Unity JobQueue Job Worker Count.

Arguments

|Name|Type|Description| |:--|:--|:--| |count|number|the Unity JobQueue Job Worker Count.|

SetLogFile(logFile: string): void

Description

Specify where Unity writes the Editor or Windows/Linux/OSX standalone log file. To output to the console, specify - for the path name. On Windows, specify the - option to direct the output to stdout, which by default is not the console.

Arguments

|Name|Type|Description| |:--|:--|:--| |logFile|string|Path name|

DisableUPM() : void

Description

Disable the Unity Package Manager.

Activation(username: string, password: string): void

Description

Activate the Unity Editor.

Arguments

|Name|Type|Description| |:--|:--|:--| |username|string|Enter a username into the log-in form during the activation of the Unity Editor.| |password|string|Enter a password into the log-in form during the activation of the Unity Editor.|

SetProjectPath(projectPath: string): void

Description

Open the project at the given path. If the pathname contains spaces, enclose it in quotes.

Arguments

|Name|Type|Description| |:--|:--|:--| |projectPath|string|Project path|

EnableReleaseCodeOptimization(): void

Description

Enables release code optimization mode, overriding the current default code optimization mode for the session.

EnableAPIUpdater(): void

Description

Use this command line option to specify that APIUpdater should run when Unity is launched in batch mode.

SetBuildTarget(target: string): void

Description

Select an active build target before loading a project.

Arguments

|Name|Type|Description| |:--|:--|:--| |target|string|Standalone, Win, Win64, OSXUniversal, Linux64, iOS, Android, WebGL, XboxOne, PS4, WindowsStoreApps, Switch,tvOS|

EnableCacheServer(endpoint: string): void

Description

Tells Unity to use the newer Accelerator Cache Server. This overrides any configuration stored in the Editor Preferences. Use this to connect multiple instances of Unity to different Cache Servers.

Arguments

|Name|Type|Description| |:--|:--|:--| |endpoint|string|Specifies the endpoint address if you are using the newer Accelerator Cache Server.Example: 127.0.0.1:10080.|

DisableManagedDebugger(): void

Description

Disables the debugger listen socket.

EnableDebugCodeOptimization(): void

Description

Enables debug code optimization mode, overriding the current default code optimization mode for the session.

SetStackTraceLogType(type: string): void

Description

Allow detailed debugging. All settings allow None, Script Only and Full to be selected.

Arguments

|Name|Type|Description| |:--|:--|:--| |type|string|"None" or "Script Only" or "Full"|

Append(arg: string): void

Append(arg: string, param: string): void

Append(args: string[]): void

Append(arg: string | string[], param?: string): void

Description

Add an argument.

Arguments

|Name|Type|Description| |:--|:--|:--| |arg|string | string[]|Commands to pass to the Unity command line| |param?|string|Parameters to be added to the command|

Build(): string[]

Description

Returns an array of arguments to be passed to the command line.

Return

|Type|Description| |:--|:--| |string[]|Argument array|