βοΈMake
AnythingWorld.AnythingMaker.Make
Declaration
public static GameObject Make(string name)public static GameObject Make(string name, params RequestParam[] parametersParameters
Description
Example
//Creates a cat with some parameters.
public class MakeACreature : MonoBehaviour
{
public void MakeACat()
{
AnythingMaker.Make("cat",
//Will add animation system if available
RequestParameter.IsAnimated(true),
//Sets position to zero
RequestParameter.Position(Vector3.zero),
//Adds default behaviours from preset
RequestParameter.SetDefaultBehaviour(),
//Set callbacks for successful creation.
RequestParameter.OnSuccessAction(PrintDebugWhenSuccessful),
//Set callback for failed creation.
RequestParameter.OnFailAction(PrintDebugWhenFail),
//Add another example script
RequestParameter.AddScripts(typeof(UserScriptExample)));
}
// This function will be invoked if model creationg process successful
public void PrintDebugWhenSuccessful()
{
Debug.Log("Finished making model!");
}
// This function will be invoked if the model creation process fails
public void PrintDebugWhenFail()
{
Debug.Log("Could not finish making model!");
}
}Last updated
Was this helpful?