You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, great documentation! I'd like to provide some hints to improve it.
it would be great if this page also contained scripting examples, since, from what is reported here, I think it is unclear how to deal with setting up such a feature dynamically. It would be wonderful to have some information about how to implement custom constrains as well.
For instance, I created this example, but I spent a lot of time to understad how, since the reference API is not so helpful (some comments are missing in this link I think: API reference )
// root of the minimap assetprivateGameObjectGoAssetRoot=null;// minimap gameobjectprivateGameObjectgoMinimap=null;// minimap structure component in the minimapprivateMinimapStructurecoMinimapStruct=null;// tools root for the minimapprivateGameObjectgoTools=null;privatevoidCreatePlaneTool(){GameObjectgoPlaneTool= GameObject.CreatePrimitive(PrimitiveType.Cube);
goPlaneTool.name ="MinimapSliderTool";
goPlaneTool.transform.SetParent(goTools.transform);
goPlaneTool.transform.localPosition =new Vector3(0.5f,0.0f,0.5f);
goPlaneTool.transform.localScale =new Vector3(1.2f,0.1f,1.2f);
goPlaneTool.GetComponent<Renderer>().material =ToolMaterial;
goPlaneTool.AddComponent<NearInteractionGrabbable>();
goPlaneTool.AddComponent<ObjectManipulator>();ConstraintManagercoConstraints= goPlaneTool.GetComponent<ConstraintManager>();MoveAxisConstraintcoConstraintX= goPlaneTool.AddComponent<MoveAxisConstraint>();
coConstraintX.ConstraintOnMovement = AxisFlags.XAxis;
coConstraintX.UseLocalSpaceForConstraint =true;MoveAxisConstraintcoConstraintZ= goPlaneTool.AddComponent<MoveAxisConstraint>();
coConstraintZ.ConstraintOnMovement = AxisFlags.ZAxis;
coConstraintZ.UseLocalSpaceForConstraint =true;}
Thank you, have a nice day!
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: f5dba7da-0ae7-6d03-cf77-0a71e0f84289
Version Independent ID: f5dba7da-0ae7-6d03-cf77-0a71e0f84289
Hello there,
First of all, great documentation! I'd like to provide some hints to improve it.
it would be great if this page also contained scripting examples, since, from what is reported here, I think it is unclear how to deal with setting up such a feature dynamically. It would be wonderful to have some information about how to implement custom constrains as well.
For instance, I created this example, but I spent a lot of time to understad how, since the reference API is not so helpful (some comments are missing in this link I think: API reference )
Thank you, have a nice day!
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: