Ejemplo n.º 1
0
 void Update()
 {
     HUD         = GameObject.Find("WeaponSlot");
     HUDReal     = GameObject.Find("HUD").GetComponent <DetectedActDeact>();
     EpickUp     = FindObjectOfType <PlayerController>();
     marketPanel = FindObjectOfType <SlideManager>();
 }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     end          = GameObject.Find("WIN").GetComponent <DetectedActDeact>();
     hud          = GameObject.Find("HUD").GetComponent <DetectedActDeact>();
     guns         = GameObject.Find("WeaponSlot");
     crosshair    = GameObject.Find("Canvas Cross");
     hitContainer = GameObject.Find("HitContainer");
     ePickUp      = GameObject.Find("E-Pickup");
     pausePanel   = GameObject.Find("Main_PausePanel");
     deathPanel   = GameObject.Find("DeathPanel");
     HUD          = GameObject.Find("HUD");
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     tutorial = GameObject.Find(toFind).GetComponent <DetectedActDeact>();
 }
Ejemplo n.º 4
0
 void Start()
 {
     slideScript = FindObjectOfType <SlideManager>();
     HUD         = GameObject.Find("HUD").GetComponent <DetectedActDeact>();
 }
Ejemplo n.º 5
0
    private void Spawn()
    {
        if (PlayerPrefs.GetInt("Checkpoint") == 1)
        {
            Vector3    position1 = new Vector3(spawn1.transform.position.x, spawn1.transform.position.y, spawn1.transform.position.z);
            GameObject PlayerSpawned;
            if (PlayerPrefs.GetInt("GodmodeActivated") == 1)
            {
                //godmodeAttiva
                PlayerSpawned = Instantiate(playerDisarmatoGOD, position1, spawn1.transform.rotation);
            }
            else
            {
                //GodmodeDisattiva
                PlayerSpawned = Instantiate(playerDisarmato, position1, spawn1.transform.rotation);
            }
            //reset score
            ScoreController scoreController = PlayerSpawned.GetComponent <ScoreController>();
            if (PlayerPrefs.GetInt("PlayerTotalScore") != 0)
            {
                PlayerPrefs.SetInt("PlayerTotalScore", 0);
                PlayerPrefs.Save();
            }
            scoreController.SetTotalScore(PlayerPrefs.GetInt("PlayerTotalScore"));
        }

        if (PlayerPrefs.GetInt("Checkpoint") == 2)
        {
            Vector3    position2 = new Vector3(spawn2.transform.position.x, spawn2.transform.position.y, spawn2.transform.position.z);
            GameObject PlayerSpawned;
            if (PlayerPrefs.GetInt("GodmodeActivated") == 1)
            {
                //godmodeAttiva
                PlayerSpawned = Instantiate(playerGOD, position2, spawn2.transform.rotation);
            }
            else
            {
                //GodmodeDisattiva
                PlayerSpawned = Instantiate(player, position2, spawn2.transform.rotation);
            }
            hudOn = GameObject.Find("HUD").GetComponent <DetectedActDeact>();
            hudOn.thing.SetActive(true);
            //set new totalscore
            PlayerSpawned.GetComponent <ScoreController>().SetTotalScore(PlayerPrefs.GetInt("PlayerTotalScore"));
        }

        if (PlayerPrefs.GetInt("Checkpoint") == 3)
        {
            Vector3    position2 = new Vector3(spawn3.transform.position.x, spawn3.transform.position.y, spawn3.transform.position.z);
            GameObject PlayerSpawned;
            if (PlayerPrefs.GetInt("GodmodeActivated") == 1)
            {
                //godmodeAttiva
                PlayerSpawned = Instantiate(playerGOD, position2, spawn3.transform.rotation);
            }
            else
            {
                //GodmodeDisattiva
                PlayerSpawned = Instantiate(player, position2, spawn3.transform.rotation);
            }
            hudOn = GameObject.Find("HUD").GetComponent <DetectedActDeact>();
            hudOn.thing.SetActive(true);
            //set new totalscore
            PlayerSpawned.GetComponent <ScoreController>().SetTotalScore(PlayerPrefs.GetInt("PlayerTotalScore"));
        }
    }