void OnGUI() { if (null == pedestrian) { return; } if (GUILayout.Button("Next")) { pedestrian.Load(pedestrian.PedestrianId + 1); pedestrian.PlayAnim(pedestrian.AnimGroup, pedestrian.animIndex, PlayMode.StopAll); } if (GUILayout.Button("Previous")) { int newId = pedestrian.PedestrianId - 1; if (newId < 0) { newId = 0; } pedestrian.Load(newId); pedestrian.PlayAnim(pedestrian.AnimGroup, pedestrian.animIndex, PlayMode.StopAll); } }
private void loadModel(int id, AnimGroup group, AnimIndex index) { pedestrian.Load(id); pedestrian.PlayAnim(group, index, PlayMode.StopAll); }