void MotionProgress(float _DeltaTime) { if (!m_UseMeteor) { return; } if (m_FlyTimer > 0.0f) { m_FlyTimer -= _DeltaTime; m_CharacterBase.m_Rigidbody.velocity = Vector3.up * 5.5f; if (m_FlyTimer <= 0.5f) { m_CharacterBase.m_Animator.SetLayerWeight(1, (1.0f - m_FlyTimer * 2.0f)); } if (m_FlyTimer <= 0.0f) { m_DurationTimer = m_Duration; SoundManager.Instance.PlayDefaultSound(m_FireDragonCharacter.m_RoarClip, 0.8f); Vector3 effpos = m_AICharacter.transform.position; effpos.y = 20.0f; LifeTimerWithObjectPool life = ObjectPool.GetObject <LifeTimerWithObjectPool>(m_SkySmokePrefb); life.Initialize(); life.transform.position = effpos; life.gameObject.SetActive(true); } return; } if (m_DurationTimer > 0.0f) { m_DurationTimer -= _DeltaTime; m_CharacterBase.m_Rigidbody.velocity = Vector3.up * 1.0f; if (m_DurationTimer <= 0.5f) { m_CharacterBase.m_Animator.SetLayerWeight(1, m_DurationTimer * 2.0f); } else { if (m_MeteorSpawnTimer > 0.0f) { m_MeteorSpawnTimer -= _DeltaTime; if (m_MeteorSpawnTimer <= 0.0f) { m_MeteorSpawnTimer = m_MeteorSpawnDelay; Vector3 mpos = m_AICharacter.transform.position; mpos.y = 25.0f; Vector3 direction = Vector3.zero; if (Random.Range(0, 100) > 40 || m_AICharacter.m_TargetCharacter == null) { mpos.x += Random.Range(-25, 25); mpos.z += Random.Range(-25, 25); direction = new Vector3(Random.Range(-0.5f, 0.5f), -1.0f, Random.Range(-0.5f, 0.5f)); } else { Vector3 targetpos = m_AICharacter.m_TargetCharacter.transform.position; targetpos.y = 0.0f; targetpos.x += Random.Range(-5, 5); targetpos.z += Random.Range(-5, 5); mpos.x = targetpos.x; mpos.z = targetpos.z; direction = new Vector3(Random.Range(-0.25f, 0.25f), -1.0f, Random.Range(-0.25f, 0.25f)); } LifeTimerWithObjectPool life = ObjectPool.GetObject <LifeTimerWithObjectPool>(m_MeteorPrefab); life.Initialize(); life.transform.position = mpos; MiniMeteorComponent meteor = life.GetComponent <MiniMeteorComponent>(); meteor.Initialize(m_FireDragonCharacter, direction, 10.0f, m_MeteorDamage, 3.5f); life.gameObject.SetActive(true); } } } if (m_DurationTimer <= 0.0f) { m_LandingTimer = m_LandingTime; } return; } if (m_LandingTimer > 0.0f) { m_LandingTimer -= _DeltaTime; if (m_LandingTimer <= 0.0f) { m_CharacterBase.m_Animator.CrossFade(m_AnimKeyFlyLand, 0.15f); LifeTimerWithObjectPool life = ObjectPool.GetObject <LifeTimerWithObjectPool>(m_FlySmokePrefab); life.Initialize(); life.transform.position = m_FireDragonCharacter.transform.position + Vector3.down; life.gameObject.SetActive(true); } } }