Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
public static AddCollider AddCollider()public static AddCollider AddCollider(bool value)public class MyTestScript : MonoBehaviour
{
string myModelPath = "C:\Users\User\Desktop\MyModel.fbx"
string myExtraAssetsPath = "C:\Users\User\Desktop\MyModelAssets"
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
private void Start()
{
AnimateMyModel();
}
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModelPath,
myExtraAssetsPath,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PollMyModel,
PrintDebugWhenAnimateFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PollMyModel(string ID)
{
AnythingAnimate.Poll(
PrintDebugWhenPollSuccessful,
PrintDebugWhenPollFail,
PrintDebugWhenPoll,
ID);
}
// This function will be invoked if the model has successfully been animated by Animate Anything
public void PrintDebugWhenPollSuccessful(ModelJson details)
{
Debug.Log("Model successfully animated!");
AnythingMaker.Make(details);
}
// This function will be invoked if an error was encountered in animating the model
public void PrintDebugWhenPollFail(string code, string message)
{
Debug.LogError("Could not animate model!");
}
// This function will be invoked whenever the model is polled for
public void PrintDebugWhenPoll(string code, string message, int seconds)
{
Debug.Log("Polling for update on my model!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenAnimateFail(string ID, UnityWebRequest error)
{
Debug.LogError("Could not send model to be animated!");
}
}public static void Poll(Action<ModelJson> onProcessFinished, Action<string, string> onProcessFail, Action<string, string, int> onProcessPoll, string id)public static void Poll(Action<ModelJson> onProcessFinished, Action<string, string> onProcessFail, Action<string, string, int> onProcessPoll, string id, int timeout)public class MyTestScript : MonoBehaviour
{
string myModelID = "416e797468696e67476f6573";
public void PollMyModel()
{
AnythingAnimate.Poll(
PrintDebugWhenSuccessful,
PrintDebugWhenFail,
PrintDebugWhenPoll,
myModelID);
}
// This function will be invoked if the model has successfully been animated by Animate Anything
public void PrintDebugWhenSuccessful(ModelJson details)
{
Debug.Log("Model successfully animated!");
}
// This function will be invoked if an error was encountered in animating the model
public void PrintDebugWhenFail(string code, string message)
{
Debug.Log("Could not animate model!");
}
// This function will be invoked whenever the model is polled for
public void PrintDebugWhenPoll(string code, string message, int seconds)
{
Debug.Log("Polling for update on my model!");
}
}public static void Animate(GameObject model, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError)public static void Animate(GameObject model, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError, string additionalAssetsPath = "")public class MyTestScript : MonoBehaviour
{
public GameObject myModel;
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModel,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PrintDebugWhenSuccessful,
PrintDebugWhenFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PrintDebugWhenSuccessful(string ID)
{
Debug.Log("Successfully sent my model to be animated!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenFail(string ID, UnityWebRequest error)
{
Debug.Log("Could not send my model to be animated!");
}
}public static void Animate(string modelPath, string additionalAssetsPath, string modelName, string modelType, string authorName, string license, bool symmetrical, bool allowSystemImprovement, Action<string> onExport, Action<string, UnityWebRequest> onError)public class MyTestScript : MonoBehaviour
{
string myModelPath = "C:\Users\User\Desktop\MyModel.fbx"
string myExtraAssetsPath = "C:\Users\User\Desktop\MyModelAssets"
string myModelName = "My Model";
string myModelType = "Human";
string authorName = "Model Author";
string myModelLicense = "MIT";
bool myModelSymmetry = true;
bool myModelUsedForImprovement = false;
public void AnimateMyModel()
{
AnythingAnimate.Animate(
myModelPath,
myExtraAssetsPath,
myModelName,
myModelType,
authorName,
myModelLicense,
myModelSymmetry,
myModelUsedForImprovement,
PrintDebugWhenSuccessful,
PrintDebugWhenFail)
}
// This function will be invoked if the model has successfully been sent to Animate Anything
public void PrintDebugWhenSuccessful(string ID)
{
Debug.Log("Successfully sent my model to be animated!");
}
// This function will be invoked if an error was encountered in sending the file to Animate Anything
public void PrintDebugWhenFail(string ID, UnityWebRequest error)
{
Debug.Log("Could not send my model to be animated!");
}
}public static RequestParameterOption Rotation(int x, int y, int z)AnythingWorld.Animation.LegacyAnimationController
AnythingWorld.Animation.MovementJumpLegacyController
public static GameObject Make(string name, params RequestParam[] parameterspublic static RequestParameterOption OnFailAction(Action<CallbackInfo> action)public static RequestParameterOption OnSuccessAction(Action<CallbackInfo> action)//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!");
}
}AnythingWorld.Animation.FlyingAnimationController











