AnythingCreator

This class allows you to access the Anything World creation engine to make objects in runtime using code.

AnythingCreator Class Reference

Public Member Functions

List< AWObj > MakeManyObjects (string objName, int quantity, bool hasBehaviour=true)

AWObj MakeObject (string objName, bool hasBehaviour=true, bool hasCollider=true)

AWObj MakeObject (string objName, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)

AWObj MakeObject (string objName, Transform transform, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)

AWObj MakeObject (string objName, Vector3 objectPos, bool hasBehaviour=true, bool hasCollider=true)

AWObj MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, bool hasBehaviour=true, bool hasCollider=true)

AWObj MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, bool hasBehaviour=true, bool hasCollider=true)

AWObj MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)

Member Functions

MakeManyObjects()

List< AWObj > AnythingWorld.AnythingCreator.MakeManyObjects (string objName, int quantity, bool hasBehaviour = true)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject(string objName, bool hasBehaviour = true, bool hasCollider = true)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Transform parentTransform, bool hasBehaviour = true, bool hasCollider = true, bool positionGlobally = false)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Transform transform, Transform parentTransform, bool hasBehaviour = true, bool hasCollider = true, bool positionGlobally = false )

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Vector3 objectPos, bool hasBehaviour = true, bool hasCollider = true)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, bool hasBehaviour = true, bool hasCollider = true)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, bool hasBehaviour = true, bool hasCollider = true)

MakeObject()

AWObj AnythingWorld.AnythingCreator.MakeObject (string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, Transform parentTransform, bool hasBehaviour = true, bool hasCollider = true, bool positionGlobally = false)

Property

Instance

AnythingCreator AnythingWorld.AnythingCreator.Instance

MadeThings

Dictionary<string, List > AnythingWorld.AnythingCreator.MadeThings

Parameters

Parameters

Type

Definition

objName

string

Name of object to be requested from server.

objectPos

Vector3

Position in scene to be applied requested object.

objectRot

Quaternion

Local rotation to be applied to requested object.

objectScale

Vector3

Local scale to be applied to request object.

parentTransform

Transform

Transform that new object will be parented to.

transfrom

Transfrom

transform to be applied to object after creation

hasBehaviour

bool

Will object receive default behaviour & animations.

hasCollider

bool

Will object receive automatically generated collider around model.

positionGlobally

bool

Will object be applied globally? (Default: false, locally)

Returns

Reference to AWObj of the object being made. Objects are generated asynchronously, make the status of your object attached to AWObj can be queried using the ObjectMade bool property.

Example

using AnythingWorld;
public class MakeSingleObject : MonoBehaviour
{
    public string objectToName = "cat";
    
    void Start()
    {
        AnythingCreator.Instance.MakeObject("cat");
    }
}
public class MakeObjectQuaternion : MonoBehaviour
    {
        public string objectToMake = "dog";
        public Vector3 vectorPosition = new Vector3(2, 1, 2);
        public Quaternion quaternionRotation = Quaternion.identity;
        private void Start()
        {
            AnythingCreator.Instance.MakeObject(objectToMake, vectorPosition, quaternionRotation);
        }
    }
using AnythingWorld;

public class MakeObjectFullCustom : MonoBehaviour
{
    public string objectToMake;
    public Vector3 objectPos;
    public Quaternion objectRotation;
    public Vector3 objectScale;
    public Transform parentTransform;
   
    void Start()
    {
        AnythingCreator.Instance.MakeObject(objectToMake, objectPos, objectRotation, objectScale, parentTransform);
    }
}

Last updated