// 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) { WIHolder whtemp = animator.gameObject.GetComponentInParent<Character>().gameObject.GetComponentInChildren<WIHolder>(); pos = whtemp.gameObject.transform.localPosition; rot = whtemp.gameObject.transform.localRotation; animator.GetComponent<IKHands>().ikActive = false; whtemp.gameObject.transform.SetParent(animator.GetComponentInChildren<RHandItPos>().gameObject.transform); whtemp.gameObject.transform.localPosition = Vector3.zero; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (_enemy == null) { _enemy = animator.GetComponent<Enemy>(); _ardColl = animator.GetComponentInChildren<AttackRangeDetector>().GetComponent<Collider>(); } _ardColl.enabled = false; }
void Awake() { particles = vulture.GetComponent <ParticleSystem>(); vulture.GetComponentInChildren <EnemyAttackCollider>().Direction = direction; box = this.GetComponent <BoxCollider2D>(); }
// 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) { agent = animator.GetComponentInChildren<NavMeshAgent>(); player = GameObject.FindWithTag("Player").transform; }
void Warning(string message) { warning.GetComponentInChildren <TextMeshProUGUI>().text = message; warning.SetTrigger("PopUp"); }
// 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.GetComponent <Boss>(); eggmanBoss = animator.GetComponentInChildren <DrEggmanBoss>(); Boss.canBeHit = false; }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.GetComponentInChildren <LaserBeam>().DeactivateBeam(); AudioMaster.Instance.PlaySoundEffect("LaserOff"); }
public void Capture(Animator anim) { anim.GetComponentInChildren <UIEffectCapturedImage>().Capture(); anim.SetTrigger("Capture"); }
private void FixedUpdate() { if (!isWalking && !isAttacking && !isDying && !gm.isBusy && !inMenu) { if (Input.GetButton("Horizontal") && Input.GetAxisRaw("Horizontal") > 0f) { if (gm.checkIfMoveableTile(mapX + 1, mapY, GameManagerGameTypeEnum.Player) || cheatMode) { targetPosition = new Vector3(playerRect.localPosition.x + gm.cellWidth, playerRect.localPosition.y, zPos); playerAnimator.SetBool("isWalking", true); playerAnimator.Play(walkAnimation); isWalking = true; playerSprite.flipX = false; mapX++; } } else if (Input.GetButton("Horizontal") && Input.GetAxisRaw("Horizontal") < 0f) { if (gm.checkIfMoveableTile(mapX - 1, mapY, GameManagerGameTypeEnum.Player) || cheatMode) { targetPosition = new Vector3(playerRect.localPosition.x - gm.cellWidth, playerRect.localPosition.y, zPos); playerAnimator.SetBool("isWalking", true); playerAnimator.Play(walkAnimation); isWalking = true; playerSprite.flipX = true; mapX--; } } else if (Input.GetButton("Vertical") && Input.GetAxisRaw("Vertical") > 0f) { if (gm.checkIfMoveableTile(mapX, mapY - 1, GameManagerGameTypeEnum.Player) || cheatMode) { targetPosition = new Vector3(playerRect.localPosition.x, playerRect.localPosition.y + gm.cellHeight, zPos); playerAnimator.SetBool("isWalking", true); playerAnimator.Play(walkAnimation); isWalking = true; mapY--; } } else if (Input.GetButton("Vertical") && Input.GetAxisRaw("Vertical") < 0f) { if (gm.checkIfMoveableTile(mapX, mapY + 1, GameManagerGameTypeEnum.Player) || cheatMode) { targetPosition = new Vector3(playerRect.localPosition.x, playerRect.localPosition.y - gm.cellHeight, zPos); playerAnimator.SetBool("isWalking", true); playerAnimator.Play(walkAnimation); isWalking = true; mapY++; } } else if (Input.GetButton("Fire1")) { //playerAnimator.SetBool("isAttacking", true); playerAnimator.Play(attackAnimation); playerAnimator.GetComponentInChildren <AudioSource>().Play(); isAttacking = true; } else if (Input.GetButtonDown("Fire2")) { inMenu = true; gameMenuManager.menuObject.SetActive(true); activeMenu = gameMenuManager; } } else if (inMenu) { activeMenu.processInput(); } }
/// <summary> /// Displays Log messages from the Manomotion Flags /// </summary> /// <param name="message">Requires the string message to be displayed</param> void DisplayLogMessage(string message) { debugLogAnimator.Play("SlideIn"); debugLogAnimator.GetComponentInChildren <Text>().text = message; }
// 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) { AudioSource soundSrc = animator.GetComponentInChildren <AudioSource>(); soundSrc.PlayDelayed(2.1f); }
//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) { particles = animator.GetComponentInChildren <ParticleSystem>(); particles.Play(); }
///Script de comportamiento durante la animación de intro de boss lvl 4. Elimina la cadena de la plataforma que se cierra detrás del jugador. //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) { Destroy(animator.GetComponentInChildren <WallDropPlatform>().gameObject); }
private void Awake() { playerSpriteRen = playerAnimator.GetComponent <SpriteRenderer>(); onGround = playerAnimator.GetComponentInChildren <OnGround>(); }
// 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.GetComponentInChildren <CircleCollider2D> ().enabled = true; }
public void Open(Animator anim) { anim.GetComponentInChildren <UIEffectCapturedImage>().Capture(); anim.gameObject.SetActive(true); anim.SetTrigger("Open"); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { goblin = animator.GetComponentInChildren <GoblinAttack>(); }
// 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) { gun_logic gun_logic = animator.GetComponentInChildren <gun_logic>(); gun_logic.reload_state(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.SetInteger("Animation", 0); animator.GetComponentInChildren <WeaponBehaviour>().comboCheck(); }
// 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.SetBool("CanAttack", false); animator.GetComponentInChildren<MeleeAttack>().GetComponent<CircleCollider2D>().enabled = true; }
// 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) { playerInfo = GameObject.FindGameObjectWithTag("GameData").GetComponent <PlayerInfo>(); animator.SetBool("Attack", true); attackPlayer = animator.GetComponentInChildren <AttackPlayer>(); }
/// <summary> /// Occurs when the animator enters the parent state, creates hand particles and targeting. /// </summary> /// <param name="animator">Reference to the parent animator.</param> /// <param name="stateInfo">Information about the state.</param> /// <param name="layerIndex">Index of the current animator layer.</param> public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // set the magic spawn point if (!tMagicSpawn) { bAI = !(animator.gameObject.tag == "Player"); if (!bAI) { tMagicSpawn = animator.GetComponentInChildren <MagicSettings>().MagicSpawnPoint; } else { tMagicSpawn = animator.GetComponentInChildren <MagicAI>().MagicSpawnPoint; } } // handle the hand particle if (SpellOptions.LimbParticleEffect && !goLimb1_ParticleInstance) { // enabled, present and not already active? if (GlobalFuncs.MAGICAL_POOL && !SpellOptions.DoNotPoolLimbParticles) { // pooling enabled? if (iLimbPoolSlotID1 > 0) { // pool slot already known goLimb1_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(iLimbPoolSlotID1 - 1, tMagicSpawn); // load from the pool } else { goLimb1_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(ref iLimbPoolSlotID1, SpellOptions.LimbParticleEffect, tMagicSpawn, SpawnTarget.Any); // load from the pool } goLimb1_ParticleInstance.SetActive(true); // enable as will be returned from the pool disabled } else { // pool disabled goLimb1_ParticleInstance = Instantiate(SpellOptions.LimbParticleEffect); // load from the prefab } if (SpellOptions.attackLimb != SpellOptions.attackLimb2) { // dont create a second particle if both limbs the same if (GlobalFuncs.MAGICAL_POOL && !SpellOptions.DoNotPoolLimbParticles) { // pooling enabled? if (SpellOptions.LimbParticleEffect2) { // does limb 2 has a different particle effect? if (iLimbPoolSlotID2 > 0) { // pool slot already known goLimb2_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(iLimbPoolSlotID2 - 1, tMagicSpawn); // load from the pool } else { goLimb2_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(ref iLimbPoolSlotID2, SpellOptions.LimbParticleEffect2, tMagicSpawn, SpawnTarget.Any); // load from the pool } } else { // nope if (iLimbPoolSlotID1 > 0) { // pool slot already known goLimb2_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(iLimbPoolSlotID1 - 1, tMagicSpawn); // load from the pool } else { goLimb2_ParticleInstance = GlobalFuncs.TheMagicalPool().GatherFromPool(ref iLimbPoolSlotID1, SpellOptions.LimbParticleEffect, tMagicSpawn, SpawnTarget.Any); // load from the pool } } goLimb2_ParticleInstance.SetActive(true); // enable as will be returned from the pool disabled } else { // pool disabled goLimb2_ParticleInstance = Instantiate((SpellOptions.LimbParticleEffect2 ? SpellOptions.LimbParticleEffect2 : SpellOptions.LimbParticleEffect)); // load from the prefab } } } // spawn all immediate if charge state if (SpellOptions.ChargeState) { // spawn over time all as long as not the charge state foreach (SpawnerOptionsOverTime sootSpawnMe in SpellOptions.SpawnOverTime) { // process all spawns immediate if (sootSpawnMe.UseRootTransform) { // ground based effect? sootSpawnMe.goSpawnedParticle = sootSpawnMe.Spawn(animator.rootPosition, Quaternion.identity, (bAI ? SpawnTarget.Friend : SpawnTarget.Enemy)); // spawn } else { // negative, use the magic spawn point sootSpawnMe.goSpawnedParticle = sootSpawnMe.Spawn(tMagicSpawn, (bAI ? SpawnTarget.Friend : SpawnTarget.Enemy)); // spawn } } } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { cursor = animator.GetComponentInChildren <CursorController>(true); cursor.gameObject.SetActive(true); }