public void InitShoot(bool _xFilp, DamageInfo _damageInfo) { m_audioFunction = m_audioFunction ?? GetComponent <AudioFunction>(); bool up = true; int num = 0; for (int i = 0; i < 4; ++i) { GameObject fireBallObject = ObjectPool.Inst.PopFromPool("FireBall"); FireBallMove fireBallMove = fireBallObject.GetComponent <FireBallMove>(); PlayerShootAttackCollider playerShootAttackCollider = fireBallObject.GetComponent <PlayerShootAttackCollider>(); if (i % 2 == 0) { num++; } if ((_xFilp && _damageInfo.attackForce.x < 0) || (!_xFilp && _damageInfo.attackForce.x > 0)) { _damageInfo.attackForce.x = _damageInfo.attackForce.x * -1; } playerShootAttackCollider.SetDamageColliderInfo(_damageInfo.damage, "Monster", _damageInfo.attackForce, this.gameObject); fireBallMove.InitFireBall(this.transform.position, distance, pointCount, height, up, _xFilp, num); up = !up; fireBallObjects[i] = fireBallObject; } }
public void InitShoot(bool _xFilp, DamageInfo _damageInfo) { for (int i = 0; i < 3; ++i) { GameObject fireBoomObject = ObjectPool.Inst.PopFromPool("FireBoom"); FireBoomCtrl fireBoomCtrl = fireBoomObject.GetComponent <FireBoomCtrl>(); PlayerShootAttackCollider playerShootAttackCollider = fireBoomObject.GetComponent <PlayerShootAttackCollider>(); if (_xFilp) { fireBoomObject.transform.position = new Vector3(this.transform.position.x + ((i + 1) * distance), this.transform.position.y, this.transform.position.z); } else { fireBoomObject.transform.position = new Vector3(this.transform.position.x - ((i + 1) * distance), this.transform.position.y, this.transform.position.z); } if ((_xFilp && _damageInfo.attackForce.x < 0) || (!_xFilp && _damageInfo.attackForce.x > 0)) { _damageInfo.attackForce.x = _damageInfo.attackForce.x * -1; } playerShootAttackCollider.SetDamageColliderInfo(_damageInfo.damage, "Monster", _damageInfo.attackForce, this.gameObject, false); fireBoomCtrl.InitFireBoom(boomSpeed); fireBoomCtrls[i] = fireBoomCtrl; } }
private IEnumerator InitCoroutine(bool _xFilp, DamageInfo _damageInfo) { for (int i = 0; i < 6; ++i) { GameObject crecentFlameObject = ObjectPool.Inst.PopFromPool("CrecentFlame"); CrecentFlameCtrl crecentFlameCtrl = crecentFlameObject.GetComponent <CrecentFlameCtrl>(); PlayerShootAttackCollider playerShootAttackCollider = crecentFlameObject.GetComponent <PlayerShootAttackCollider>(); Vector3 position = this.transform.position; if (i % 2 == 0) { position.x = position.x + distance + ((int)(i * 0.5f + 1) * distance * (int)(i * 0.5f)); } else { position.x = position.x - distance - ((int)(i * 0.5f + 1) * distance * (int)(i * 0.5f)); } crecentFlameObject.transform.position = position; Vector3 scale = crecentFlameObject.transform.localScale * ((int)(i * 0.5f) + 1); if ((i % 2 != 0 && scale.x > 0) || (i % 2 == 0 && scale.x < 0)) { scale.x = scale.x * -1; } crecentFlameObject.transform.localScale = scale; if ((i % 2 == 0 && _damageInfo.attackForce.x < 0) || (i % 2 != 0 && _damageInfo.attackForce.x > 0)) { _damageInfo.attackForce.x = _damageInfo.attackForce.x * -1; } playerShootAttackCollider.SetDamageColliderInfo(_damageInfo.damage, "Monster", _damageInfo.attackForce, this.gameObject, false); crecentFlameCtrl.InitCrecentFlame(); crecentFlameCtrls[i] = crecentFlameCtrl; if (i % 2 == 0) { yield return(null); } else { yield return(new WaitForSeconds(createSpeed)); } } }