-
Notifications
You must be signed in to change notification settings - Fork 17
CardboardBox
Namespace: TommoJProductions.ModApi.Attachable
Represents The Cardboard Box (Package). Can hold multiple parts. Can be unpacked. Press the use button while looking at the package to open it.
public class CardboardBox : Package
Inheritance Object → Package → CardboardBox
Has the cardboard box been opened.
public bool opened { get; }
The folding box instance. (cardboard box with physics)
public GameObject foldingBox { get; }
GameObject
The folding box sheet parent. all sheets are a child of this transform.
public Transform sheets { get; }
Transform
The cardboard box behaviour.
public CardboardBoxBehaviour behaviour { get; }
The cardboard box prefab.
public virtual GameObject packagePrefab { get; }
GameObject
All the parts inside the package.
public GameObject[] packedObjects { get; }
GameObject[]
The package gameobject. The carboard box.
public GameObject package { get; }
GameObject
The packages model.
public GameObject model { get; }
GameObject
The package settings. pos, rot, size, part pos, rot.
public PackageSettings settings { get; }
The packages rigidbody.
public Rigidbody packageRigidBody { get; }
Rigidbody
The total calculated mass of the package.
public float packageMass { get; }
Sets Package parameters to defaults.
public CardboardBox()
Sets Package parameters. Default position. (0, 0, 0) Haybed out back of house.
public CardboardBox(string name)
name
String
The name of the package
Sets Package parameters.
public CardboardBox(string name, Vector3 packagePosition, Vector3 packageRotation, Vector3 packageScale)
name
String
The name of the package
packagePosition
Vector3
The package spawn position.
packageRotation
Vector3
The package spawn rotation
packageScale
Vector3
The package scale.
Sets Package parameters.
public CardboardBox(PackageSettings packageSettings)
packageSettings
PackageSettings
Waits then picks a random child and destorys it. Repeats until there arent anymore sheets.
protected virtual IEnumerator sheetVanish()
IEnumerator
USAGE: StartCoroutine()
Opens the cardboard box.
public virtual void openPackage()
Creates the cardboard box.
public virtual void createPackage(GameObject[] objects)
objects
GameObject[]