void OnGUI() { GUILayout.BeginVertical(); GUILayout.ExpandHeight(true); var gameobject = Selection.activeGameObject; if (gameobject != null) { GUILayout.Label(gameobject.name, EditorStyles.boldLabel); var customAnimationContrller = gameobject.GetComponent <CustomAnimationController>(); if (customAnimationContrller != null && customAnimationContrller.ActionList != null) { _lastSellectedController = customAnimationContrller; for (int i = 0; i < customAnimationContrller.ActionList.Count; ++i) { var action = customAnimationContrller.ActionList[i]; GUILayout.Label(action.GetType().ToString(), EditorStyles.boldLabel); if (GUILayout.Button("Remove Action", GUILayout.Width(100))) { if (customAnimationContrller.ActionList.Remove(action)) { --i; continue; } } try { foreach (var property in action.GetType().GetProperties()) { var propertyValue = property.GetValue(action, null); if (propertyValue is float) { EditorGUILayout.FloatField(property.Name.ToString(), (float)propertyValue); } } } catch (Exception ex) { Debug.Log(ex.Message); } } GUILayout.BeginHorizontal(); GUILayout.ExpandWidth(true); if (GUILayout.Button("Add Action")) { AddActionWindow.ShowWindow(); } GUILayout.ExpandWidth(false); GUILayout.EndHorizontal(); } } GUILayout.ExpandHeight(false); GUILayout.EndVertical(); }
private void Awake() { CustomAnimController = GetComponent <CustomAnimationController>(); _animInfos = new AnimationInfos(CustomAnimController); _thisObject = GetComponent <BaseObject>(); LoadResource(); }
public override void OnBuffRemove() { CustomAnimationController animationController = GetAnimationController(); if (animationController != null) { animationController.SetAnimatorSpeed(currentAnimatorSpeed); } holder.statusManager.RemoveStatus(RoleStatus.STUN); }
protected virtual void Start() { TargetsInAttackArea = new List <GameObject>(); Rigidbody = GetComponent <Rigidbody>(); AnimationClips = AnimationClipsLoader.GetAnimationClips(gameObject.tag, "Movement"); MovementAnimationDictionary = InitAnimationsDictionary(); PlayableGraphObject = new PlayableGraph(); AnimationBody = HelperTools.FindObjectInChildWithTag(gameObject, "BodyModel"); CustomAnimationController = new CustomAnimationController(AnimationBody, AnimationBody.GetComponent <Animator>(), MovementAnimationDictionary, PlayableGraphObject); }
public override void OnBuffRemove() { CustomAnimationController animationController = GetAnimationController(); if (animationController != null) { animationController.SetAnimatorSpeed(currentAnimatorSpeed); } holder.GetComponent <Rigidbody>().isKinematic = false; holder.statusManager.RemoveStatus(RoleStatus.FROZEN); }
//private float currentMoveSpeed; //private float currentAngularSpeed; public override void OnBuffApply() { CustomAnimationController animationController = GetAnimationController(); if (animationController != null) { currentAnimatorSpeed = animationController.animator.speed; animationController.SetAnimatorSpeed(0.2f); } holder.statusManager.AddStatus(RoleStatus.STUN); }
protected virtual void FixedUpdate() { if (lastAnimState != AnimationState) { CustomAnimationController.ChangeWeight(AnimationState, weight); weight += 0.1f; } if (weight >= 1.0f) { CustomAnimationController.ChangeWeight(AnimationState, 1.0f); weight = 0.0f; lastAnimState = AnimationState; } }
public virtual void Awake() { baseAgentController = transform.GetComponent <BaseAgentController>(); GameObject gameManager = GameObject.FindGameObjectWithTag("GameController"); prafabHolder = gameManager.GetComponent <PrafabHolder>(); aiUtils = gameManager.GetComponentInChildren <AIUtils>(); animationController = transform.GetComponentInChildren <CustomAnimationController>(); eventHelper = transform.GetComponentInChildren <SimpleEventHelper>(); shootPoint = aiUtils.GetShootPoint(transform); player = GameObject.FindGameObjectWithTag("Player"); currentRole = GetComponent <Enemy>(); currentRole.statusManager.notifyStatusChange += OnStatusChange; eventHelper.notifyGetHit += OnGetHit; currentState = AIState.IDLE; stateStartTime = Time.time; progress = AIProgress.END; resetPatrolPoint(); }
//private float currentMoveSpeed; //private float currentAngularSpeed; public override void OnBuffApply() { CustomAnimationController animationController = GetAnimationController(); if (animationController != null) { currentAnimatorSpeed = animationController.animator.speed; animationController.SetAnimatorSpeed(0); } holder.statusManager.AddStatus(RoleStatus.FROZEN); holder.GetComponent <Rigidbody>().isKinematic = true; Transform model = gameObject.transform.parent.GetChild(0); ShaderChanger shaderChanger = model.gameObject.AddComponent <ShaderChanger>(); shaderChanger.newShader = prafabHolder.GetShader("ice"); shaderChanger.timeToChangeBack = duration; ShowEffect(OtherEffects[0], true); ShowEffect(OtherEffects[1], true); }
public AnimationInfos(CustomAnimationController controller) { _animController = controller; }