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

Crate

Namespace: TommoJProductions.ModApi.Attachable

Represents The Crate (Package). Can hold multiple parts. Can be unpacked. Use the Digging Bar to pry open the crate!

public class Crate : Package

Inheritance ObjectPackageCrate

Fields

behaviour

public PryBehaviour behaviour;

Properties

packagePrefab

The wooden crate prefab.

public 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

Crate()

Sets Package parameters to defaults.

public Crate()

Crate(String)

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

public Crate(string name)

Parameters

name String
The name of the package

Crate(String, Vector3, Vector3, Vector3)

Sets Package parameters.

public Crate(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.

Crate(PackageSettings)

Sets Package parameters.

public Crate(PackageSettings packageSettings)

Parameters

packageSettings PackageSettings

Methods

openPackage()

Opens the package.

public virtual void openPackage()

createPackage(GameObject[])

Creates the wooden crate.

public virtual void createPackage(GameObject[] objects)

Parameters

objects GameObject[]
The gameobjects to pack inside.

Clone this wiki locally