コード例 #1
0
 void ChangePath(WPController newController)
 {
     if (newController == null || newController == controller)
     {
         return;
     }
     controller = newController;
     TraverseFromClosestPoint();
 }
コード例 #2
0
        //==================================================
        //  UNITY METHODS
        //==================================================

        void Start()
        {
            rb = GetComponent <Rigidbody>();
            if (rb == null)
            {
                useRigidbody = false;
            }
            if (controllers == null || controllers.Length == 0)
            {
                Debug.LogError("No Controller set for WPTraverser attached to " + name);
            }
            defaultController = Mathf.Clamp(defaultController, 0, controllers.Length - 1);
            controller        = controllers[defaultController];
        }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            WPController PC = (WPController)target;

            if (GUILayout.Button("Toggle Group 1"))
            {
                PC.ToggleGroup(NODE_GROUP.GROUP1);
            }
            if (GUILayout.Button("Toggle Group 2"))
            {
                PC.ToggleGroup(NODE_GROUP.GROUP2);
            }
            if (GUILayout.Button("Toggle Group 3"))
            {
                PC.ToggleGroup(NODE_GROUP.GROUP3);
            }
        }