/// <summary> /// hooks up the component object as the inspector target /// </summary> public virtual void OnEnable() { m_Component = (vp_FootstepManager)target; m_Component.SetDirty(true); }
/// <summary> /// /// </summary> public virtual void DoSurfaceTypesFoldout() { vp_FootstepManager[] footstepManagers = vp_FootstepManager.FootstepManagers; if (footstepManagers == null || footstepManagers.Length == 0) { EditorGUILayout.HelpBox("Could not find a vp_FootstepManager component in the hierarchy.", MessageType.Info); return; } vp_FootstepManager footstepManager = footstepManagers[0]; if (footstepManager == null) { EditorGUILayout.HelpBox("Could not find a vp_FootstepManager component in the hierarchy.", MessageType.Info); return; } List <vp_FootstepManager.vp_SurfaceTypes> SurfaceTypes = footstepManager.SurfaceTypes; if (SurfaceTypes == null || SurfaceTypes.Count == 0) { EditorGUILayout.HelpBox("No surface types have been added to the footstep manager.", MessageType.Info); return; } string[] surfaces = new string[SurfaceTypes.Count]; for (int i = 0; i < SurfaceTypes.Count; ++i) { vp_FootstepManager.vp_SurfaceTypes surface = SurfaceTypes[i]; surfaces[i] = surface.SurfaceName; } GUILayout.Space(15); GUILayout.BeginHorizontal(); EditorGUILayout.Popup("Surface Type", m_Component.SurfaceID, surfaces); GUILayout.EndHorizontal(); GUILayout.Space(15); }
// Use this for initialization protected override void Awake() { base.Awake(); // initial setup m_Audio = GetComponent<AudioSource>(); m_CharacterController = gameObject.GetComponent<CharacterController>(); m_Controller = (vp_FPController)transform.root.GetComponentInChildren(typeof(vp_FPController)); m_Player = (ac_FPParkourEventHandler)transform.root.GetComponentInChildren(typeof(ac_FPParkourEventHandler)); m_Camera = GetComponentInChildren<vp_FPCamera>(); m_Transform = transform; m_FootstepManager = (vp_FootstepManager)transform.root.GetComponentInChildren(typeof(vp_FootstepManager)); m_currentDoubleJump = DoubleJumpCount ; m_CanWallRunAgain = Time.time; m_CanDashAgain = Time.time; m_CanGroundslideAgain = Time.time; // spawn the parkour arm at world origin and hide it if(ParkourArmPrefab != null) { ParkourArmPrefab = (GameObject)Object.Instantiate(ParkourArmPrefab,Vector3.zero,Quaternion.identity); ParkourArmPrefab.SetActive(false); } }