public override void OnInspectorGUI()
    {
        GenerateCurve myScript = (GenerateCurve)target;

        DrawDefaultInspector();

        if (GUILayout.Button("Calculate Random Points"))
        {
            myScript.CalculateRandomPoints();
        }
        if (myScript.hasRandomPoints())
        {
            if (GUILayout.Button("Draw Random Mesh"))
            {
                myScript.BuildMeshBezier();
            }
        }
    }
示例#2
0
        public override void AgentReset()
        {
            // Reset wire by generating a new curve
            _generateCurve.CalculateRandomPoints();
            _generateCurve.BuildMeshBezier();

            // Reset arm rig (position and velocities)
            for (int i = 0; i < _rigs.Length; i++)
            {
                _rigs[i].Reset();
            }
            _ringNewPos   = _ring.position;
            _ringOldPos   = _ring.position;
            _ringVelocity = Vector3.zero;


            // Reset JointController target rotation and strength
            foreach (var bodyPart in _jdController.bodyPartsDict.Values)
            {
                bodyPart.Reset(bodyPart);
            }
        }