Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Questions
#7
I did stumble on this code to initialize the rope during runtime.  After my rope is created, I would call InitTheRope();

    private IEnumerator InitRope()
    {
        yield return rope.GeneratePhysicRepresentationForMesh();
    }
 
    public void InitTheRope()
    {
        StartCoroutine(InitRope());
    }


To get this to work, I had to update some code, ObiBoneEditor.cs

change line 150 & 159 from

EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());

to

if (!Application.isPlaying) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());


To get the rope to update will the application is running, I used this code.

public void RefreshTheRope()
{
    ObiRope rope = gameObject.GetComponent<ObiRope>();
    rope.OnEnable();
}
Reply


Messages In This Thread
Scripting Questions - by Parker - 13-09-2017, 05:11 AM
RE: Scripting Questions - by josemendez - 13-09-2017, 10:01 AM
RE: Scripting Questions - by Parker - 15-09-2017, 05:36 AM
RE: Scripting Questions - by josemendez - 15-09-2017, 08:14 AM
RE: Scripting Questions - by Parker - 15-09-2017, 01:34 PM
RE: Scripting Questions - by Parker - 16-09-2017, 07:25 PM
RE: Scripting Questions - by Parker - 16-09-2017, 10:23 PM