コード例 #1
0
        //properly destroy current pedestrian
        public void DestroyPedestrian(PedestrianSystemManager pedestrianSystem)
        {
            if (!isDestroyed)
            {
                isDestroyed = true;

                pedestrianSystem.curPedestiansSpawned--;
                Destroy(this.gameObject);
            }
        }
コード例 #2
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            PedestrianSystemManager myScript = (PedestrianSystemManager)target;

            if (GUILayout.Button("Get Waypoints"))
            {
                myScript.GetWaypoints();
            }

            if (GUILayout.Button("Add Waypoint"))
            {
                myScript.AddWaypoint();
            }

            if (GUILayout.Button("Remove Waypoint"))
            {
                myScript.RemoveLastWaypoint();
            }
        }