/// ------------------------------------------------------------------------------------------ /// <summary> /// 这里暂时先这么实现各种子弹,子弹1射击的效果 /// </summary> /// ------------------------------------------------------------------------------------------ private void FireEffect1(Vector3 shootVector, Vector3 position) { GameObject shellInstance = null; if (ExplosionManager.s_InstanceExists) { shellInstance = ExplosionManager.s_Instance.CreateVisualBullet(position, shootVector, 0, BulletClass.FiringExplosion); } shellInstance.SetActive(true); shellInstance.transform.localScale = Vector3.one; shellInstance.transform.position = position; shellInstance.transform.forward = shootVector; // 忽略与自身的碰撞 Physics.IgnoreCollision(shellInstance.GetComponent <Collider>(), GetComponentInChildren <Collider>(), true); InstantBullet shell = shellInstance.GetComponent <InstantBullet>(); shell.Setup(0, null, 100); }
/// ------------------------------------------------------------------------------------------ /// <summary> /// ������ʱ����ôʵ�ָ����ӵ����ӵ�1�����Ч�� /// </summary> /// ------------------------------------------------------------------------------------------ private void FireEffect1(Vector3 shootVector, Vector3 position, int randSeed) { GameObject shellInstance = null; if (ExplosionManager.s_InstanceExists) { shellInstance = ExplosionManager.s_Instance.CreateVisualBullet(position, shootVector, 0, BulletClass.FiringExplosion); } shellInstance.SetActive(true); shellInstance.transform.localScale = Vector3.one; shellInstance.transform.position = position; shellInstance.transform.forward = shootVector; // �������������ײ Physics.IgnoreCollision(shellInstance.GetComponent <Collider>(), GetComponentInChildren <Collider>(), true); InstantBullet shell = shellInstance.GetComponent <InstantBullet>(); shell.Setup(0, null, 100); //shell.transform.rotation = Quaternion.Euler(new Vector3(transform.rotation.eulerAngles.x, m_curLookatDeg, transform.rotation.eulerAngles.z)); }