Click or drag to resize

ASLHelperInstantiateASLObject Method (PrimitiveType, Vector3, Quaternion, String, 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,
	string _componentAssemblyQualifiedName
)

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
_componentAssemblyQualifiedName
Type: SystemString
The full name of the component to be added to this object upon creation. When you use a Unity component, things are slightly different. For example, to add a Rigidbody component, you would enter this: "UnityEngine.Rigidbody,UnityEngine" In this case, the pattern is still the namespace + component, but then it is followed with by ",UnityEngine". If you need UnityEditor, try that after the comma
Examples
void SomeFunction()
{
    //Using just the name space and the class name should be enough for _componentAssemblyQualifiedName. For more info, go here
    //https://docs.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=netframework-4.8#System_Type_AssemblyQualifiedName
    ASL.ASLHelper.InstantiateASLObject(PrimitiveType.Cube, new Vector3(0, 0, 0), Quaternion.identity, gameobject.GetComponent<ASL.ASLObject>().m_Id, "MyNamespace.MyComponent"); 

    //Note: If you need to add more than 1 component to an object, you will need to use the _aslGameObjectCreatedCallbackInfo parameter as well. 
    //See those instantiation overload options for more details
}
See Also