예제 #1
0
 private void Awake()
 {
     m_Rigidbody       = GetComponent <Rigidbody>();
     m_particleManager = Instantiate <GameObject>(m_particleManager);
     m_bulletParticles = m_particleManager.GetComponent <BulletParticles>();
     m_bulletParticles.transform.position = transform.position;
     m_bulletParticles.velocity           = -GetComponent <Rigidbody>().velocity / 5;
     m_bulletParticles.random             = -m_bulletParticles.velocity.normalized;
 }
예제 #2
0
            // ...

            protected void instantiateParticles(GameObject gameObject)
            {
                GameObject obj = Instantiate(gameObject);

                obj.transform.position = transform.position;

                BulletParticles bulletParticles =
                    gameObject.GetComponent <BulletParticles>();

                if (bulletParticles)
                {
                    if (bulletParticles.orientToBullet)
                    {
                        obj.transform.rotation = transform.rotation;
                    }
                }

                //objectsToUnparentOnDestroy.Add(obj.transform);
            }