Skip to content

Package

Tommo J. Phillips edited this page Oct 22, 2023 · 3 revisions

Package

Namespace: TommoJProductions.ModApi.Attachable

Represents a package that can hold multiple parts. Can be unpacked.

public abstract class Package

Inheritance ObjectPackage

Properties

packagePrefab

The package prefab.

public abstract virtual GameObject packagePrefab { get; }

Property Value

GameObject

packedObjects

All the parts inside the package.

public GameObject[] packedObjects { get; }

Property Value

GameObject[]

package

The package gameobject. The carboard box.

public GameObject package { get; }

Property Value

GameObject

model

The packages model.

public GameObject model { get; }

Property Value

GameObject

settings

The package settings. pos, rot, size, part pos, rot.

public PackageSettings settings { get; }

Property Value

PackageSettings

packageRigidBody

The packages rigidbody.

public Rigidbody packageRigidBody { get; }

Property Value

Rigidbody

packageMass

The total calculated mass of the package.

public float packageMass { get; }

Property Value

Single

Constructors

Package()

Sets Package parameters to defaults.

public Package()

Package(String)

Sets Package parameters. Default position. (0, 0, 0) Haybed out back of house.

public Package(string name)

Parameters

name String
The name of the package

Package(String, Vector3, Vector3, Vector3)

Sets Package parameters.

public Package(string name, Vector3 packagePosition, Vector3 packageRotation, Vector3 packageScale)

Parameters

name String
The name of the package

packagePosition Vector3
The package spawn position.

packageRotation Vector3
The package spawn rotation

packageScale Vector3
The package scale.

Package(PackageSettings)

Sets Package parameters.

public Package(PackageSettings packageSettings)

Parameters

packageSettings PackageSettings

Methods

createFunction()

createPackage phase 2. Destroys all part rigidbodies. Waits until rigidbody is Destroyed, Deactivates part and sets the parts parent to the package.

protected virtual IEnumerator createFunction()

Returns

IEnumerator

spawnParts()

The part spawn logic. enables the parts inside the package.

protected virtual void spawnParts()

createPackage(GameObject[])

Creates a package with within.

public virtual void createPackage(GameObject[] objects)

Parameters

objects GameObject[]
the gameobjects to pack into the created box.

openPackage()

Opens the package.

public abstract virtual void openPackage()

Clone this wiki locally