Esempio n. 1
0
    public static void PlayMusic()
    {
        AudioSource MusicSource = GameObject.Find("AudioSFX").GetComponent <AudioSource>();

        if (GameLevelManager.GetSceneName() == "Main Menu")
        {
            MusicSource.clip = Music[1];
            MusicSource.Play();
            MusicSource.loop = true;
        }
        else if (GameLevelManager.GetSceneName() == "World1_1")
        {
            MusicSource.clip = Music[0];
            MusicSource.Play();
            MusicSource.loop = true;
        }
        else if (GameLevelManager.GetSceneName() == "HighScoreManagement")
        {
            MusicSource.clip = Music[2];
            MusicSource.Play();
            MusicSource.loop = true;
        }
        else if (GameLevelManager.GetSceneName() == "boss")
        {
            MusicSource.clip = Music[3];
            MusicSource.Play();
            MusicSource.loop = true;
        }
        else if (GameLevelManager.GetSceneName() == "GameOver")
        {
            MusicSource.clip = Music[1];
            MusicSource.Play();
            MusicSource.loop = true;
        }
    }
Esempio n. 2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Pivot" && this.gameObject.tag == "Camera Switch")               // CHANGE CAMERA POSITION
        {
            cameraManager.ChangeCamera();
            Destroy(this.gameObject);
        }
        if (other.gameObject.tag == "Pivot" && this.gameObject.tag == "TriggerSpawn")                   // SPAWN ENEMIES
        {
            SpawnerController.SpawnWave(this.transform.position, this.gameObject.name);
            Destroy(this.gameObject);
        }
        if (gameObject.tag == "End_Level" && other.gameObject.tag == "Pivot")
        {
            GameLevelManager.HighScore();
        }
        if (gameObject.tag == "End_Level" && other.gameObject.tag == "VFX")
        {
            if (GameLevelManager.GetSceneName() == "World1_1")
            {
                return;
            }
            else
            {
                GameLevelManager.LoadNextLevel();
            }
        }

        if (gameObject.name == "HighScores")
        {
            ToggleScoreONOFF();
        }

        if (gameObject.name == "Head" && other.gameObject.tag == "VFX")
        {
            Avatar.Stun();
        }
        if (gameObject.name == "tail" && other.gameObject.tag == "VFX")
        {
            Avatar.MakeAvatarJump();
        }


        if (gameObject.name == "Continue" && other.gameObject.tag == "VFX")
        {
            GameLevelManager.Continue();
            UIController.ResetScore();
        }
        if (gameObject.name == "Quit" && other.gameObject.tag == "VFX")
        {
            GameLevelManager.ReturnToMenu();
            UIController.ResetScore();
        }

        if (gameObject.name == "Crystal")
        {
            gameObject.GetComponent <ItemControl>().DamageBoss();
        }
    }
Esempio n. 3
0
 private static void UpdateScoreText()
 {
     if (GameLevelManager.GetSceneName() == "HighScoreManagement")
     {
         return;
     }
     else
     {
         ScoreDisplay.GetComponent <TextMesh>().text = scoreValue.ToString();
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (GameLevelManager.GetSceneName() == "World1_1")
     {
         ControlShootHelper();
     }
     if (Input.GetButtonDown("Fire1"))
     {
         VFXManager.SpawnShootVRX(shootRot);
         SoundManager.PlaySFX("Shoot", shootRot.transform);
     }
     Debug.DrawRay(Camera.main.transform.position, Camera.main.transform.forward * 100, Color.red);
 }
Esempio n. 5
0
    void Start()
    {
        AddObjectsToList();

        if (GameLevelManager.GetSceneName() == "boss")
        {
            BossScene     = true;
            PreviousIndex = 0;
        }
        else
        {
            BossScene = false;
        }
    }