public override void OnInspectorGUI() { FGroundFitter_Base targetScript = (FGroundFitter_Base)target; List <string> exclude = new List <string>(); exclude.Add("drawDebug"); exclude.Add("drawGizmo"); exclude.Add("RelativeLookUp"); exclude.Add("RelativeLookUpBias"); if (targetScript.LookAheadRaycast == 0f) { exclude.Add("AheadBlend"); } if (!targetScript.ZoneCast) { exclude.Add("ZoneCastDimensions"); exclude.Add("ZoneCastOffset"); exclude.Add("ZoneCastBias"); exclude.Add("ZoneCastPrecision"); } DrawPropertiesExcluding(serializedObject, exclude.ToArray()); FEditor.FEditor_StylesIn.DrawUILine(Color.black * 0.24f); DrawRootMotionParameters(); GUILayout.Space(5); //serializedObject.ApplyModifiedProperties(); }
protected virtual void Start() { if (TargetGroundFitter == null) { TargetGroundFitter = GetComponent <FGroundFitter_Base>(); } if (TargetGroundFitter) { TargetGroundFitter.GlueToGround = false; } agent = GetComponent <NavMeshAgent>(); agent.Warp(transform.position); agent.SetDestination(transform.position); moving = false; lastAgentPosition = transform.position; reachedDestination = true; animationClips = new FAnimationClips(GetComponentInChildren <Animator>()); animationClips.AddClip("Idle"); if (FAnimatorMethods.StateExists(animationClips.Animator, "Move") || FAnimatorMethods.StateExists(animationClips.Animator, "move")) { movementClip = "Move"; } else { movementClip = "Walk"; } animationClips.AddClip(movementClip); }
public override void OnInspectorGUI() { FGroundFitter_Base targetScript = (FGroundFitter_Base)target; List <string> exclude = new List <string>(); if (targetScript.LookAheadRaycast == 0f) { exclude.Add("AheadBlend"); } if (!targetScript.RelativeLookUp) { exclude.Add("RelativeLookUpBias"); } if (!targetScript.ZoneCast) { exclude.Add("ZoneCastDimensions"); exclude.Add("ZoneCastOffset"); exclude.Add("ZoneCastBias"); exclude.Add("ZoneCastPrecision"); } DrawPropertiesExcluding(serializedObject, exclude.ToArray()); serializedObject.ApplyModifiedProperties(); }
private void Reset() { TargetGroundFitter = GetComponent <FGroundFitter_Base>(); if (TargetGroundFitter) { TargetGroundFitter.GlueToGround = false; } agent = GetComponent <NavMeshAgent>(); if (agent) { agent.acceleration = 1000; agent.angularSpeed = 100; } }