# AnythingCreator

## AnythingCreator Class Reference

### Public Member Functions

> `List<`` `<mark style="color:blue;">`AWObj`</mark>` ``>`` `<mark style="color:blue;">`MakeManyObjects`</mark>` ``(string objName, int quantity, bool hasBehaviour=true)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, bool hasBehaviour=true, bool hasCollider=true)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Transform transform, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Vector3 objectPos, bool hasBehaviour=true, bool hasCollider=true)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Vector3 objectPos, Quaternion objectRot, bool hasBehaviour=true, bool hasCollider=true)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, bool hasBehaviour=true, bool hasCollider=true)`
>
> <mark style="color:blue;">`AWObj MakeObject`</mark>` ``(string objName, Vector3 objectPos, Quaternion objectRot, Vector3 objectScale, Transform parentTransform, bool hasBehaviour=true, bool hasCollider=true, bool positionGlobally=false)`

### Member Functions

#### <mark style="color:purple;">MakeManyObjects()</mark>

List< <mark style="color:blue;">AWObj</mark> > AnythingWorld.AnythingCreator.MakeManyObjects (string <mark style="color:blue;">objName</mark>, int <mark style="color:blue;">quantity</mark>, bool <mark style="color:blue;">hasBehaviour</mark> = true)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject(string <mark style="color:blue;">objName</mark>, bool <mark style="color:blue;">hasBehaviour</mark> = true, bool <mark style="color:blue;">hasCollider</mark> = true)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Transform <mark style="color:blue;">parentTransform</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider =</mark> true, bool <mark style="color:blue;">positionGlobally =</mark> false)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Transform <mark style="color:blue;">transform</mark>, Transform <mark style="color:blue;">parentTransform</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider = true</mark>, bool <mark style="color:blue;">positionGlobally =</mark> false )

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Vector3 <mark style="color:blue;">objectPos</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider =</mark> true)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Vector3 <mark style="color:blue;">objectPos</mark>, Quaternion <mark style="color:blue;">objectRot</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider =</mark> true)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Vector3 <mark style="color:blue;">objectPos</mark>, Quaternion <mark style="color:blue;">objectRot</mark>, Vector3 <mark style="color:blue;">objectScale</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider =</mark> true)

#### <mark style="color:purple;">MakeObject()</mark>

<mark style="color:blue;">AWObj</mark> AnythingWorld.AnythingCreator.MakeObject (string <mark style="color:blue;">objName</mark>, Vector3 <mark style="color:blue;">objectPos</mark>, Quaternion <mark style="color:blue;">objectRot</mark>, Vector3 <mark style="color:blue;">objectScale</mark>, Transform <mark style="color:blue;">parentTransform</mark>, bool <mark style="color:blue;">hasBehaviour =</mark> true, bool <mark style="color:blue;">hasCollider =</mark> true, bool <mark style="color:blue;">positionGlobally =</mark> false)

### Property

#### <mark style="color:purple;">Instance</mark>

<mark style="color:blue;">AnythingCreator</mark> AnythingWorld.AnythingCreator.Instance

#### <mark style="color:purple;">MadeThings</mark>

Dictionary\<string, List > AnythingWorld.AnythingCreator.MadeThings

### Parameters

| **Parameters**                                      | **Type**   | **Definition**                                                     |
| --------------------------------------------------- | ---------- | ------------------------------------------------------------------ |
| <mark style="color:blue;">`objName`</mark>          | string     | Name of object to be requested from server.                        |
| <mark style="color:blue;">`objectPos`</mark>        | Vector3    | Position in scene to be applied requested object.                  |
| <mark style="color:blue;">`objectRot`</mark>        | Quaternion | Local rotation to be applied to requested object.                  |
| <mark style="color:blue;">`objectScale`</mark>      | Vector3    | Local scale to be applied to request object.                       |
| <mark style="color:blue;">`parentTransform`</mark>  | Transform  | Transform that new object will be parented to.                     |
| <mark style="color:blue;">`transfrom`</mark>        | Transfrom  | transform to be applied to object after creation                   |
| <mark style="color:blue;">`hasBehaviour`</mark>     | bool       | Will object receive default behaviour & animations.                |
| <mark style="color:blue;">`hasCollider`</mark>      | bool       | Will object receive automatically generated collider around model. |
| <mark style="color:blue;">`positionGlobally`</mark> | bool       | Will object be applied globally? (Default: false, locally)         |

### Returns

Reference to [AWObj](https://anything-world.gitbook.io/anything-world/unity-1/legacy-package-api-references/api-references/broken-reference) 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

```csharp
using AnythingWorld;
public class MakeSingleObject : MonoBehaviour
{
    public string objectToName = "cat";
    
    void Start()
    {
        AnythingCreator.Instance.MakeObject("cat");
    }
}
```

```csharp
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);
        }
    }
```

```csharp
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);
    }
}
```
