Click or drag to resize

ASLHelperInstantiateASLObject Method (PrimitiveType, Vector3, Quaternion, String)

Create an ASL Object

Namespace:  ASL
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public static void InstantiateASLObject(
	PrimitiveType _type,
	Vector3 _position,
	Quaternion _rotation,
	string _parentID
)

Parameters

_type
Type: PrimitiveType
The primitive type to be instantiated
_position
Type: Vector3
The position where the object will be instantiated
_rotation
Type: Quaternion
The rotation orientation of the object to be instantiated
_parentID
Type: SystemString
The id or name of the parent object for this instantiated object
Examples
void SomeFunction()
{
    //Where gameObject is the parent of the object that is being created here
    ASL.ASLHelper.InstantiateASLObject(PrimitiveType.Cube, new Vector3(0, 0, 0), Quaternion.identity, gameobject.GetComponent<ASL.ASLObject>().m_Id); 
}
void SomeOtherFunction()
{
    ASL.ASLHelper.InstantiateASLObject(PrimitiveType.Cube, new Vector3(0, 0, 0), Quaternion.identity, ""); //Using this overload (and others) and passing in an empty string is a valid option 
}
void WoahAnotherFunction()
{
    //Where 'MyParentObject' is the name of the parent of the object that is being created here
    ASL.ASLHelper.InstantiateASLObject(PrimitiveType.Cube, new Vector3(0, 0, 0), Quaternion.identity, "MyParentObject"); 
    //The parent of your object can also be found by passing in the name (e.g., gameObject.name) of the parent you want. However, this method is a lot slower than using the ASL ID method, 
    //but it is the only way to assign a non-ASL Object as a parent to an ASL Object for all users
}
See Also