Beispiel #1
0
    public static void StartGame()
    {
        GameObject.Find("SkyboxCam").GetComponent <Animator> ().SetTrigger("fall");

        #region reset
        foreach (GameObject go in GameObject.FindGameObjectsWithTag("Obstacle"))
        {
            GameObject.Destroy(go);
        }

        Camera.main.GetComponent <GameEngine> ().context.transform.position = Vector3.zero;
        rocketMan.transform.localPosition = Vector3.zero;
        rocketMan.Revive();
        rocketMan.ExplodeWing();

        //reset spawner
        GameEngine.gameSpeed     = 10;
        spawner.groupRotateSpeed = 4;
        spawner.wave             = 1;

        //reset player
        rocketMan.completedWave    = 0;
        rocketMan.currentDirection = 1;
        rocketMan.currentAxis      = 0;
        rocketMan.boost            = 1;
        rocketMan.gunLifeTimer     = 0;
        rocketMan.SetShield(false);
        rocketMan.SetParticleEffects(true);

        points      = 0;
        currentWave = 0;
        #endregion
        //Start Spawn
        spawner.BeginBlockSpawnCycle();

        //state
        gameInProgress = true;


        //UI
        ui.SetUIGameState(true);
        ui.UpdateScore(points);
    }