Example #1
0
        void Fire()
        {
            GameObject o = (GameObject)Instantiate(ProjectilePrefab);

            o.transform.Translate(gameObject.transform.position + SpawnOffset);
            ConstVelocity c = o.GetComponent <ConstVelocity>();

            c.Velocity = ShotVelocity;
        }
        void Start()
        {
            int i;

            for (i = 0; i < WarmUpIterations; i++)
            {
                GameObject    o  = SpawnOne();
                ConstVelocity cv = o.GetComponent <ConstVelocity>();
                if (cv != null)
                {
                    o.transform.Translate(cv.Velocity * i * Interval);
                }
            }
        }