public override void Act(BaseFSM FSM) { if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.Ripple) { if (BagManager.Instance.skillAttributesList[0].isOn) { BagManager.Instance.UseMagic(0); FSM.PlayAnimation("Magic Shoot Attack"); AudioManager.PlaySound2D("Ripple").Play(); NetworkManager.SendPlayerMagic("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); } } } if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.Ripple) { if (BagManager.Instance.skillAttributesList[1].isOn) { BagManager.Instance.UseMagic(1); FSM.PlayAnimation("Magic Shoot Attack"); AudioManager.PlaySound2D("Ripple").Play(); NetworkManager.SendPlayerMagic("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); } } } }
public override void Act(BaseFSM FSM) { if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.HeartAttack) { if (BagManager.Instance.skillAttributesList[0].isOn) { BagManager.Instance.UseMagic(0); FSM.PlayAnimation("Magic Shoot Attack"); //GameObject go = NetPoolManager.Instantiate("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); AudioManager.PlaySound2D("HeartAttack").Play(); //go.GetComponent<MagicBehaviour>().isHit = true; //NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.HeartAttack) { if (BagManager.Instance.skillAttributesList[1].isOn) { BagManager.Instance.UseMagic(1); FSM.PlayAnimation("Magic Shoot Attack"); //GameObject go = NetPoolManager.Instantiate("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); AudioManager.PlaySound2D("HeartAttack").Play(); //go.GetComponent<MagicBehaviour>().isHit = true; //NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } }
public override void Act(BaseFSM FSM) { FSM.PlayAnimation("Falling"); FSM.controller.Gravity = 20; FSM.controller.Wings.gameObject.SetActive(true); FSM.controller.FallingCtrl(5f); }
public override void Act(BaseFSM FSM) { FSM.PlayAnimation("Jump"); FSM.controller.Jump(FSM.characterStatus.jumpSpeed); }
public override void Act(BaseFSM FSM) { FSM.PlayAnimation("Run"); FSM.controller.Move(FSM.characterStatus.moveSpeed, FSM.characterStatus.jumpSpeed); }
public override void Act(BaseFSM FSM) { FSM.PlayAnimation("Defend"); }
public IEnumerator ArrayDely() { float attackRange = 5.2f; float swordCount = 8.0f; Transform[] sword = new Transform[(int)swordCount]; GameObject ArraySword = pool.CreateObject("SwordArrayPool", transform.position + transform.forward * 18 + Vector3.up, transform.rotation); CameraView(12, 4, 44); for (int i = 0; i < sword.Length; i++) { sword[i] = ArraySword.transform.GetChild(0).GetChild(i); sword[i].DOMove(sword[0].parent.position + new Vector3(attackRange * Mathf.Cos(i * 2 * Mathf.PI / swordCount), 3, attackRange * Mathf.Sin(i * 2 * Mathf.PI / swordCount)), 1); } //获取剑阵中心半径为5的范围内的敌人 Collider[] colliders = Physics.OverlapSphere(ArraySword.transform.position, 5); for (int i = 0; i < colliders.Length; i++) { if (colliders[i].tag == "Enemy") { colliders[i].GetComponent <EnemyState>().OnDamage(GetComponent <PlayerState>().attack); enemy = colliders[i].GetComponent <BaseFSM>(); enemy.isBeAttack = true; print(enemy.isBeAttack); print(colliders[i].name); } } //ArraySword.transform.DORotate(ArraySword.transform.eulerAngles + 360 * Vector3.up, 1); yield return(new WaitForSeconds(1.4f)); transform.DOLookAt(sword[6].position, 0.04f); transform.DOMove(sword[6].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[1].position, 0.04f); transform.DOMove(sword[1].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[4].position, 0.04f); transform.DOMove(sword[4].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[7].position, 0.04f); transform.DOMove(sword[7].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[2].position, 0.04f); transform.DOMove(sword[2].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[5].position, 0.04f); transform.DOMove(sword[5].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[0].position, 0.04f); transform.DOMove(sword[0].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[3].position, 0.04f); transform.DOMove(sword[3].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[6].position, 0.04f); transform.DOMove(sword[6].position, 0.3f); yield return(new WaitForSeconds(0.3f)); transform.DOLookAt(sword[2].position, 0.04f); Camera.main.GetComponent <ThirdPersonCamera>().enabled = true; transform.DOMove(sword[2].position - Vector3.up * 3, 0.3f); yield return(new WaitForSeconds(0.3f)); anim.PlayAnim(AnimationName.swordAttackend_3); for (int i = 0; i < sword.Length; i++) { sword[i].localPosition = Vector3.zero; } transform.GetChild(1).gameObject.SetActive(false); if (enemy != null) { enemy.isBeAttack = false; enemy.PlayAnimation(AnimationName.idle); } pool.MyDestory(ArraySword); }