private void Start()
    {
        gameManager = GameObject.FindGameObjectWithTag("GAMEMANAGER").GetComponent <GAMEMANAGER>();

        timeSalirPinxos = timePinxos;
        timeCounter     = 0;
    }
    // ---------------------------------------------------------------


    // DEBUT DE PARTIE --------------------------------------------------------------
    void Awake()
    {
        if (access == null)
        {
            access = this;
        }
        else
        {
            Destroy(this);
        }
        players     = new List <PlayerScript>();
        motherships = new List <MotherShipScript>();
        music       = GetComponentInChildren <AudioSource>();
        canvas      = GameObject.Find("CANVAS_MENUS").GetComponent <Canvas>().transform;
        gameUI      = GameObject.Find("CANVAS_UI");
        canvas.gameObject.SetActive(true);
        isPaused  = false;
        isPlaying = false;
        if (!musicVolume)
        {
            musicVolume = GameObject.Find("MusicSlider").GetComponent <Slider>();
        }
        if (!soundVolume)
        {
            soundVolume = GameObject.Find("SoundSlider").GetComponent <Slider>();
        }
    }
    // Use this for initialization
    void Start()
    {
        player         = GameObject.FindGameObjectWithTag("Player").GetComponent <PLAYER_VIDA>();
        anim           = GetComponent <Animator>();
        Time.timeScale = 1;

        gameManager = GameObject.FindGameObjectWithTag("GAMEMANAGER").GetComponent <GAMEMANAGER>();
    }
Exemple #4
0
    // Update is called once per frame

    void Update()
    {
        gm = GameObject.Find("GAMEMANAGER").GetComponent <GAMEMANAGER>();
        if (gm.RPGFightTime)
        {
            this.GetComponent <AudioSource>().clip = RPGFightMusic;
            this.GetComponent <AudioSource>().Play();
        }
    }
Exemple #5
0
 void Awake()
 {
     if (GM != null && GM != this)
     {
         DestroyImmediate(gameObject);
         return;
     }
     GM = this;
     DontDestroyOnLoad(gameObject);
 }
Exemple #6
0
 //Esta funcion se encarga de que el Game Object que almacena a este script este presente en todas las escenas y no se repita.
 void hacerUnico()
 {
     if (instancia != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instancia = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
Exemple #7
0
    public void Ini()
    {
        player = GetComponent <PLAYER>();
        Guardar_Posicion();
        currentHealth = startingHealth;

        gameManager = GameObject.FindGameObjectWithTag("GAMEMANAGER").GetComponent <GAMEMANAGER>();

        timeCounter = GameObject.FindGameObjectWithTag("TIME").GetComponent <TimeCounter>();

        // Update life UI
        gameManager.PlayerLife(currentHealth);
    }
    private void Awake()
    {
        if (m_Instance != null)
        {
            Destroy(this);
        }
        else
        {
            m_Instance = this;
        }

        DontDestroyOnLoad(gameObject);
    }
Exemple #9
0
    void Awake()
    {
        if (inst == null)
        {
            inst = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        SceneManager.sceneLoaded += Carrega;
    }
Exemple #10
0
    //public string nomePassaro;

    //public bool passaroLancado = false;
    //public Transform objE, objD;

    //public int numPorcosCena;
    //private bool tocaWin = false, tocaLose = false;
    //public bool lose;

    //public bool estrela1Fim, estrela2Fim;
    //public int aux;

    //public int estrelasNum;
    //public bool trava = false;

    //public int pontosGame, bestPontoGame;
    //public int moedasGame;

    //public bool pausado = false;



    void Awake()
    {
        //ZPlayerPrefs.Initialize("12345678", "pombobravogame");
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }


        SceneManager.sceneLoaded += Carrega;
    }
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
        SceneManager.sceneLoaded += Carrega;


        txtBallLife       = GameObject.Find("BallLifesTxt").GetComponent <Text>();
        txtPassesCount    = GameObject.Find("PassesCounttxt").GetComponent <Text>();
        ballPositionStart = GameObject.Find("posStart").GetComponent <Transform>();
    }
Exemple #12
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        if (PlayerPrefs.HasKey("PrimeiraVez") == false)
        {
            PlayerPrefs.SetInt("PrimeiraVez", 0);
            primeiraVez = PlayerPrefs.GetInt("PrimeiraVez");
        }


        SceneManager.sceneLoaded += Carrega;
    }
 // Use this for initialization
 void Start()
 {
     gamePaused  = false;
     gameManager = GameObject.FindGameObjectWithTag("GAMEMANAGER").GetComponent <GAMEMANAGER>();
 }