// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.GetComponentInParent <EnemyController2D>().enabled = false; animator.GetComponentInParent <Rigidbody2D>().simulated = false; animator.GetComponentInParent <Soldier>().healthBar.transform.parent.gameObject.SetActive(false); animator.GetComponentInParent <CircleCollider2D>().enabled = false; }
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Destroy(animator.gameObject); animator.GetComponentInParent <PetInfo>().InstantiateParticle(Actions.Dead); Instantiate(tombstone, animator.GetComponentInParent <PetMovement>().transform.position, Quaternion.Euler(-90, 0, 0), animator.GetComponentInParent <PetInfo>().transform); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (animator.GetComponentInParent<Character>().Status == Character.Statuses.ATTACKING) { animator.GetComponentInParent<Character>().Status = Character.Statuses.READY; } }
public void Health(float Damage) { Phealth -= (int)Damage; if (Phealth <= 0) { Phealth = 0; Robot.enabled = true; Robot.Play("RobotArmature|Robot_Death"); Robot.GetComponentInParent <moving>().enabled = false; Robot.GetComponentInParent <CharacterController>().enabled = false; free.enabled = false; cC.dead = true; } if (Phealth > 10) { Phealth = 10; } if (Damage > 0) { for (int i = PTemphealth; i > Phealth; i--) { Healthbars[i - 1].SetActive(false); } } else { for (int i = PTemphealth; i < Phealth; i++) { Healthbars[i].SetActive(true); } } PTemphealth = Phealth; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { base.OnStateEnter(animator, stateInfo, layerIndex); if (m_IKs == null) { GetIKs(animator.transform); } if (m_Target == null) { m_Target = animator.GetComponentInParent <TargetCmpt>(); } if (m_Trans == null) { m_Trans = animator.GetComponentInParent <PeTrans>(); } if (m_Target == null || m_Target.GetAttackEnemy() == null) { return; } if (m_IKs == null || m_IKs.Length <= 0) { return; } if (m_Trans != null) { GetPoint(m_Trans.trans, m_Target.GetAttackEnemy().position); } }
public void ActivateIt() { activated = true; if (animator == null) { animator = GetComponent <Animator>(); } animator.SetBool("ButtonActivated", true); if (objectanimated != null) { if (!objectanimated.transform.parent.gameObject.activeInHierarchy) { objectanimated.transform.parent.gameObject.SetActive(true); } if (objectanimated.GetComponentInParent <IActivablePrefab>() != null) { objectanimated.GetComponentInParent <IActivablePrefab>().enabled = false; } if (!objectanimated.gameObject.activeInHierarchy) { objectanimated.gameObject.SetActive(true); } objectanimated.SetBool(animationobject, true); } // anim.SetBool(ButtonActivated, true); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _isAttacking = false; _damageDealerComponent = animator.GetComponentInParent <DamageDealerComponent>(); _interactableComponent = animator.GetComponentInParent <InteractableComponent>(); _damageTakerComponent = animator.GetComponentInParent <DamageTakerComponent>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { thrown = false; cdSpawn.restart(); animator.GetComponentInParent <AiMovement>().SetRotationPoint(new Vector2(animator.GetFloat("aimX"), animator.GetFloat("aimY"))); fraction = animator.GetComponentInParent <AiFraction>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator anim, AnimatorStateInfo stateInfo, int layerIndex) { cb = anim.GetComponentInParent <script_childBehaviour>(); rb = anim.GetComponentInParent <Rigidbody>(); mc = anim.GetComponentInChildren <script_maskController>(); mc.free(); rb.isKinematic = false; bool cond = cb.asthmatic; if (cond) { nextState = childState.idle; } switch (nextState) { case childState.idle: anim.SetTrigger("idle"); break; case childState.walk: anim.SetTrigger("walk"); break; case childState.run: cb.startRunning(true); anim.SetTrigger("run"); break; } }
private void LazyInit(Animator animator) { baseSkillController = animator.GetComponentInParent <Tang.BaseSkillController>(); roleController = animator.GetComponentInParent <Tang.RoleController>(); skeletonAnimator = animator.gameObject.GetComponent <SkeletonAnimator>(); valid = skeletonAnimator != null && skeletonAnimator.FrameEventDic != null; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.SetBool("TurnPage", false); animator.SetBool("TurnPageReverse", false); if (animator.GetComponentInParent <BookManager> () != null) { animator.GetComponentInParent <BookManager> ().pageTurnComplete(); } }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _seeker = animator.GetComponentInParent <Seeker>(); _stateController = animator.GetComponentInParent <HandyStateController>(); _movementController = animator.GetComponentInParent <HandyMovementController>(); _stateController.PlayerInRange += PlayerInRange; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { pintor = animator.GetComponentInParent <Humano>(); rb = animator.GetComponentInParent <Rigidbody2D>(); //if (pintor != null) //{ //Debug.Log(pintor.name + " Esta Parado"); //} }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.SetBool("Jump", false); animator.SetBool("Hurricane", false); animator.SetBool("YMCA", false); animator.SetBool("Interact", false); animator.GetComponentInParent <SnowMelter>().currentBrushSize = animator.GetComponentInParent <SnowMelter>().brushSize; animator.GetComponentInParent <PlayerFoliage>().currentFoliageSpawnRadius = animator.GetComponentInParent <PlayerFoliage>().foliageSpawnRadius; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { combatController = animator.GetComponentInParent <CombatController>(); movementController = animator.GetComponentInParent <MovementController>(); //Mientras el jugador esté en posición de bloqueo, podrá dashear (por eso canDash no se altera), pero no podrá atacar ni moverse. combatController.isBlocking = true; combatController.canAttack = false; movementController.canMove = false; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { boss = animator.GetComponentInParent <GiantEyeBoss>(); sr = animator.GetComponent <SpriteRenderer>(); rb = animator.GetComponentInParent <Rigidbody2D>(); timeBtwShotsValue = timeBtwShots; timeBtwFlashValue = timeBtwFlash; flashTimeValue = flashTime; defMat = sr.material; rb.velocity = Vector2.zero; }
IEnumerator Fade() { CanvasGroup canvasGroup = animator.GetComponentInParent <Image>().GetComponent <CanvasGroup>(); while (canvasGroup.alpha < 1f) { canvasGroup.alpha += Time.deltaTime / 1.5f; yield return(null); } Application.Quit(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { var decay = animator.GetComponentInParent <DecayObject>(); decay.StartDecay(); var collider = animator.GetComponentInParent <Collider>(); if (collider != null) { collider.enabled = false; } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { combatController = animator.GetComponentInParent <CombatController>(); movementController = animator.GetComponentInParent <MovementController>(); //Hacemos al jugador invulnerable durante el tiempo que dure la animación de 'recibir daño' y bloqueamos su capacidad de movimiento y ataque. //combatController.isVulnerable = false; //^Linea comentada porque entraba en conflicto con algunos ataques enemigos (por ejemplo, el Anima Killer, que solo podía hacer daño una vez al ser 4 proyectiles juntos) combatController.canAttack = false; movementController.canDash = false; movementController.canMove = false; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} //OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { int lives = animator.GetComponentInParent <TempPlayer>().getLives(); if (lives > 0) { animator.GetComponentInParent <TempPlayer>().Respawn(); } else { GameOver.GameEnded(); } }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.GetComponentInParent <EnemyController2D>().enabled = false; animator.GetComponentInParent <Rigidbody2D>().simulated = false; animator.GetComponentInParent <FireWorm>().healthBar.transform.parent.gameObject.SetActive(false); animator.GetComponentInParent <FireWorm>().enabled = false; var colliders = animator.GetComponentsInParent <CapsuleCollider2D>(); foreach (var collider in colliders) { collider.enabled = false; } }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { inim = animator.GetComponentInParent <IAInimigo>(); agente = animator.GetComponentInParent <NavMeshAgent>(); // Não permite repetiro ponto do { alvo = inim.pontos[Random.Range(0, inim.pontos.Length)].position; } while (proximoAlvo()); // Manda mover para o ponto agente.SetDestination(alvo); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { player = GameObject.FindGameObjectWithTag("Player").transform; rb = animator.GetComponentInParent <Rigidbody2D>(); sr = animator.GetComponentInChildren <SpriteRenderer>(); defMat = sr.material; boss = animator.GetComponentInParent <GiantEyeBoss>(); dashTimeValue = dashTime; attackTimeValue = attackTime; chargeTimeValue = chargeTime; boss.audioManager.StopMusic(); boss.audioManager.PlayMusic("BossFight"); boss.isInvulnerable = false; }
public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _progress = stateInfo.normalizedTime; if (_progress >= 1) { _progress = 0; animator.GetComponentInParent <HeroAnim>().SwitchMode(Utils.HeroMode.Move); } // amplitude = f(progress), such that f(0) = 0, f(0.5) = 1, f(1) = 0, using a quadratic polynomial var amplitude = 4 * (1 - _progress) * _progress; animator.GetComponentInParent <Transform>().localPosition = new Vector3(0, yMax * amplitude, 0); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { var skelsp = animator.GetComponentInParent <Skelsp>(); skelsp.IsAnimUpdating = true; skelsp.OnStartFire(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (animator.GetLayerWeight(layerIndex) > 0) { animator.GetComponentInParent <LevController> ().stopCustomAnimation(); } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (navAgent == null) { navAgent = animator.GetComponentInParent <NavMeshAgent>(); } }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Controller = Controller ?? animator.GetComponentInParent <HedgehogController>(); if (Controller == null) { return; } if (GroundFriction != UnchangedValue) { Controller.GroundFriction = GroundFriction; } if (GravityDirection != UnchangedValue) { Controller.GravityDirection = GravityDirection; } if (AirGravity != UnchangedValue) { Controller.AirGravity = AirGravity; } if (AirDrag != UnchangedValue) { Controller.AirDrag = AirDrag; } if (SlopeGravity != UnchangedValue) { Controller.SlopeGravity = SlopeGravity; } }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Instantiate(prefabParticle, animator.transform.position, prefabParticle.transform.rotation); CAnimationMoveComponent t = animator.GetComponentInParent <CAnimationMoveComponent>(); t.OneMoveComplete(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Debug.Log("Stop"); var rigidbody = animator.GetComponentInParent<Rigidbody>(); store = rigidbody.constraints; rigidbody.constraints = RigidbodyConstraints.FreezeAll; }
// OnStateEnter is called before OnStateEnter is called on any state inside this state machine public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (stateInfo.IsTag("DestroyState")) { animator.GetComponentInParent<BaseEnemy>().DestroyEnemy(stateInfo.length); } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { bullet = animator.GetComponentInParent <Transform>().gameObject; Debug.Log(bullet); bullet.SetActive(true); bulletAnimator = bullet.GetComponent <Animator>(); }
protected void lazyInit(Animator animator) { if (roleController == null) { roleController = animator.GetComponentInParent <RoleController>(); } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if(animator.GetBool("Grounded")) { UnityEngine.Random rnd = new UnityEngine.Random(); //animator.GetComponentInParent<Rigidbody>().AddForce(new Vector3(rnd.RandomRange(-1.0f, 1.0f), rnd.RandomRange(-20.0f, 20.0f), rnd.RandomRange(-1.0f, 1.0f)); animator.GetComponentInParent<Rigidbody>().AddForce(new Vector3(0f, 20f, 0f)); animator.SetBool("Grounded", false); } }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { //animator.transform.parent.GetComponent<Actor>(); m_Actor = animator.GetComponentInParent<Actor>(); if(m_Actor.AI.CURRENT_AI_STATE == eAIStateType.AI_STATE_ATTACK) { m_Actor.AI.IS_ATTACK = true; m_bIsAttack = false; } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { _playerCollider2D = animator.GetComponentsInParent<Collider2D>(); for (int i = 0; i < _playerCollider2D.Length; i++) { _playerCollider2D[i].enabled = false; } if (DisableGravity) { _playerRigidBody2D = animator.GetComponentInParent<Rigidbody2D>(); _gravitySaved = _playerRigidBody2D.gravityScale; _playerRigidBody2D.gravityScale = 0.0f; _velocitySaved = _playerRigidBody2D.velocity; _playerRigidBody2D.velocity = Vector2.zero; } }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { WalkerController controller = animator.GetComponentInParent<WalkerController> (); controller.Died (); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.GetComponentInParent<Transform> ().GetComponentInParent<PartyGroup> ().Facing (true); }
// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { var rigidbody = animator.GetComponentInParent<Rigidbody>(); rigidbody.constraints = store; }
//OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // BossAttack attackScript = animator.GetComponentInParent<BossAttack>(); // attackScript.ToggleMeleeCollider(); //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} //OnStateExit is called when a transition ends and the state machine finishes evaluating this state public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { BossAIScript aiScript = animator.GetComponentInParent<BossAIScript>(); aiScript.Attacking = false; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // animator.GetComponentInParent<Transform> ().GetComponentInParent<AudioSource> ().Play (); }