private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "PlayerBall" && _isInPosition && _currentState == AltAssistBehavior.AssistState.MultiplyFire && !_isInTransition) { BallBehavior bb = other.gameObject.GetComponent <BallBehavior>(); bool createByAssist = bb.GetCreateByAssist(); float velocity = bb.GetVelocity(); if (!createByAssist) { bb.gameObject.SetActive(false); BallBehavior bb1 = SpawnManager.Instance.GetPooledBall(); bb1.transform.position = Vector3.up + transform.position + (-transform.right * 1.25f); bb1.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, -90f, 0f)); bb1.Init(velocity, "PlayerBall", true); BallBehavior bb2 = SpawnManager.Instance.GetPooledBall(); bb2.transform.position = Vector3.up + transform.position + (-transform.forward * 1.25f); bb2.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, 180f, 0f)); bb2.Init(velocity, "PlayerBall", true); BallBehavior bb3 = SpawnManager.Instance.GetPooledBall(); bb3.transform.position = Vector3.up + transform.position + (transform.right * 1.25f); bb3.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, 90f, 0f)); bb3.Init(velocity, "PlayerBall", true); BallBehavior bb4 = SpawnManager.Instance.GetPooledBall(); bb4.transform.position = Vector3.up + transform.position + (transform.forward * 1.25f); bb4.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, 0f, 0f)); bb4.Init(velocity, "PlayerBall", true); } } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "PlayerBall" && (_currentState == AssistState.MultiplyFire || _currentState == AssistState.MultiplyVelocity)) { BallBehavior bb = other.gameObject.GetComponent <BallBehavior>(); bool createByAssist = bb.GetCreateByAssist(); float velocity = bb.GetVelocity(); switch (_currentState) { case AssistState.MultiplyFire: if (!createByAssist) { other.gameObject.SetActive(false); BallBehavior bb1 = SpawnManager.Instance.GetPooledBall(); bb1.transform.position = Vector3.up + transform.position + (-transform.right * 1.25f); bb1.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, -90f, 0f)); bb1.Init(velocity, "PlayerBall", true); BallBehavior bb2 = SpawnManager.Instance.GetPooledBall(); bb2.transform.position = Vector3.up + transform.position + (-transform.forward * 1.25f); bb2.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, 180f, 0f)); bb2.Init(velocity, "PlayerBall", true); BallBehavior bb3 = SpawnManager.Instance.GetPooledBall(); bb3.transform.position = Vector3.up + transform.position + (transform.right * 1.25f); bb3.transform.rotation = Quaternion.Euler(transform.eulerAngles + new Vector3(0f, 90f, 0f)); bb3.Init(velocity, "PlayerBall", true); } break; case AssistState.MultiplyVelocity: bb.SetVelocity(2f); break; } } else if (other.gameObject.tag == "EnemyBall" && (_currentState == AssistState.Shield)) { switch (_currentState) { case AssistState.Shield: other.gameObject.SetActive(false); break; } } }