Ejemplo n.º 1
0
    public void SpawnDebry()
    {
        if (alive == true)
        {
            if (numberOfObjects <= 0)
            {
                try
                {
                    for (int x = 0; x < numOfEnemysToCreate; x++)
                    {
                        createdObject             = Instantiate(debryObject, spawnPos, Quaternion.identity) as GameObject;
                        ClosingSpeed              = createdObject.GetComponentInChildren <OrbitClosingIn>();
                        ClosingSpeed.FallingSpeed = fallSpeed;

                        numberOfObjects++;
                        //debrySpawned++;

                        /*	toDo
                         *  adjust for the speed to increase only once every Group Spawn of 5 or more
                         */
                        if (numberOfObjects == 0)
                        {
                            fallSpeed += 0.0005f;
                            CameraRotate.rotateSpeed.z += 0.1f;
                            //debrySpawned = 0;
//							Debug.Log (CameraRotate.rotateSpeed.z);
                        }
                    }
                    numOfEnemysToCreate++;
                }
                catch {
                }
            }
        }
    }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     render          = GetComponent <SpriteRenderer> ();
     closingDistance = GetComponentInParent <OrbitClosingIn> ();
 }