unityeditor

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ConnectionTimeout = 60 * time.Minute
View Source
const (
	Manager = "unity_editor"
)
View Source
const (
	StartupTimeout = 2 * time.Minute
)

Variables

View Source
var (
	ErrorGetProjectVersion = errors.New("could not determine the project / unity version")
)

Functions

func GetUnityEditorPath added in v1.0.0

func GetUnityEditorPath(editorPath string, projectVersion string) string

GetUnityEditorPath is the editor binary of the version below editorPath. Only macOS is supported, other systems give an empty path.

func GetUsedUnityVersion added in v1.0.0

func GetUsedUnityVersion(projectDir string) (string, error)

GetUsedUnityVersion reads the editor version of the Unity project.

Types

type Deps added in v1.2.0

type Deps struct {
	Runner device.CommandRunner
	Clock  device.Clock
	// GOOS is the operating system the editor runs on, runtime.GOOS by default.
	GOOS string
}

Deps are the external collaborators of the Handler. Zero fields get the real implementations.

type Device

type Device struct {
	generic.Device
	generic.Info
	// contains filtered or unexported fields
}

Device is a Unity editor that registered itself with the hub. It supports the Identity, AppManager (start and stop only), AppConnection, Locker, TestLogger and ActionHandlerRegistry roles; recording and screenshots are not supported.

func (*Device) ConnectionTimeout

func (d *Device) ConnectionTimeout() time.Duration

func (*Device) DeviceIP

func (d *Device) DeviceIP() net.IP

func (*Device) DeviceState

func (d *Device) DeviceState() device.State

func (*Device) HandleManagerConnection added in v1.0.0

func (d *Device) HandleManagerConnection()

HandleManagerConnection serves the editor's websocket until it closes. The device is booted while the connection lives.

func (*Device) InstallApp

func (d *Device) InstallApp(_ *app.Parameter) error

func (*Device) IsAppConnected

func (d *Device) IsAppConnected() bool

func (*Device) IsAppInstalled

func (d *Device) IsAppInstalled(_ *app.Parameter) (bool, error)

IsAppInstalled is always true: the editor runs the project, there is nothing to install.

func (*Device) SetDeviceState

func (d *Device) SetDeviceState(state string)

SetDeviceState sets the state from its name, see device.ParseState.

func (*Device) StartApp

func (d *Device) StartApp(_ *device.DeviceConfig, _ *app.Parameter, sessionId string, nodeUrl string) error

func (*Device) StopApp

func (d *Device) StopApp(_ *app.Parameter) error

func (*Device) UninstallApp

func (d *Device) UninstallApp(_ *app.Parameter) error

func (*Device) UnityLogStartListening added in v1.0.0

func (d *Device) UnityLogStartListening()

UnityLogStartListening follows the editor's log file until UnityLogStopListening.

func (*Device) UnityLogStopListening added in v1.0.0

func (d *Device) UnityLogStopListening()

type Handler

type Handler struct {
	generic.Registry[*Device]
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(cfg config.Manager, ds storage.Device) *Handler

func NewHandlerWithDeps added in v1.2.0

func NewHandlerWithDeps(cfg config.Manager, ds storage.Device, deps Deps) *Handler

func (*Handler) Init

func (m *Handler) Init(masterUrl, nodeIdentifier string, authToken *string) error

func (*Handler) Name

func (m *Handler) Name() string

func (*Handler) RefreshDevices

func (m *Handler) RefreshDevices(_ bool) error

RefreshDevices marks editors that were silent for too long as shut down and stores the devices that changed.

func (*Handler) RegisterDevice

func (m *Handler) RegisterDevice(data device.RegisterData) (device.Device, error)

RegisterDevice adds an editor that connected, or refreshes the known one, and serves its websocket in the background.

func (*Handler) Start

func (m *Handler) Start() error

func (*Handler) StartDevice

func (m *Handler) StartDevice(deviceID string) error

func (*Handler) Stop

func (m *Handler) Stop() error

func (*Handler) StopDevice

func (m *Handler) StopDevice(deviceID string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL