Exemple #1
0
    // Start is called before the first frame update

    private void Start()
    {
        myAudioSource = GetComponent <AudioSource>();
        SpawnPoint.SetActive(true);
        //EnemySpawn.SetActive(true);
        Enemy.SetActive(true);
        health = 1;
        // Bhasfe
        GameSceneManager = GameObject.FindObjectOfType <sceneManager>();
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     Network   = NetworkManager.Instance;
     Scene     = sceneManager.Instance;
     IPField   = GameObject.Find("IPField").GetComponent <InputField>();
     PORTField = GameObject.Find("PortField").GetComponent <InputField>();
     Popup     = GameObject.Find("POPUP");
     Popup.SetActive(false);
     Network.setStart(this);
 }
Exemple #3
0
    void Awake()
    {
        if (Instance != this)
        {
            Destroy(gameObject);
            return;
        }
        DontDestroyOnLoad(gameObject);

        Scene = sceneManager.Instance;
    }
Exemple #4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        mytf = GetComponent <Transform>();
        myrb = GetComponent <Rigidbody>();
        GameObject tempObj = GameObject.Find("Player");

        tf             = tempObj.GetComponent <Transform>();
        tempObj        = GameObject.Find("Main Camera");
        scriptInstance = tempObj.GetComponent <sceneManager>();
        scriptInstance.EventoDisparoRecibido += gotShot;
    }
 void Start()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         DontDestroyOnLoad(gameObject);
         Instance = this;
     }
 }
Exemple #7
0
 void OnTriggerEnter(Collider other)
 {
     // Check for the asteroid
     if (other.gameObject.tag == "enemy1")
     {
         // Create explosion on impact
         Instantiate(explosion, transform.position, transform.rotation);
         sceneManager scenem = oursceneManager.GetComponent <sceneManager>();
         PlayerPrefs.SetInt("SCORE", scenem.GetScore());
         StartCoroutine(GameOver("GameOver", 0.75f));
     }
 }
Exemple #8
0
 // Use this for initialization
 void Start()
 {
     if (instance != null)
     {
         GameObject.Destroy(gameObject);
     }
     else
     {
         GameObject.DontDestroyOnLoad(gameObject);
         instance = this;
     }
 }
Exemple #9
0
 void Start()
 {
     // Makes sure that the GameManager this is attached to is always the same one, so we can use it to keep values through scenes.
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Exemple #10
0
    //add buttons, set text for each upgrade and set to MAX when fully upgraded

    void Start()
    {
        upgradeManager = GameObject.FindGameObjectWithTag("UpgradeManager").GetComponent <upgradeManager>();
        sceneManager   = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <sceneManager>();
        scoreText.text = upgradeManager.getPlayerScore().ToString();
        updateMaxBoostsButton();
        updateGroundSpeedReductionButton();
        updateLaunchForceButton();
        updateEnemySpeedReductionButton();
        updateTruckFrequencyButton();
        updateBombEnemyFrequencyButton();
        initializeMenuButtons();
    }
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
     currentScene = SceneManager.GetActiveScene().name;
     lastScene    = currentScene;
     DontDestroyOnLoad(this.gameObject);
 }
Exemple #12
0
    // Use this for initialization
    void Start()
    {
        chattingFlag = false;
        channelFlag  = false;

        chatBar      = GameObject.Find("Chatting_Bar").GetComponent <ScrollRect>();
        chatText     = chatBar.GetComponentInChildren <TextMeshProUGUI>();
        chatContent  = chatBar.content.gameObject;
        renderCanvas = GameObject.Find("renderCanvas").GetComponent <Canvas>();
        chatQueue    = new Queue <TextMeshProUGUI>();
        otherPlayer  = new Dictionary <ulong, Player>();
        chDropdown   = GameObject.Find("Channel").GetComponent <Dropdown>();
        chDropdown.onValueChanged.AddListener(delegate { dropDownFunction(chDropdown); });
        cineCamera = GameObject.Find("cineCamera").GetComponent <Cinemachine.CinemachineVirtualCamera>();

        defaultPosition  = new Vector2(-164.0f, 1110.0f);
        otherPlayerColor = new Color(183, 165, 119, 255);

        Scene   = sceneManager.Instance;
        Network = NetworkManager.Instance;
        Network.setChatMng(this);

        request_playerData();
    }
Exemple #13
0
    // Start is called before the first frame update
    void Start()
    {
        sm = FindObjectOfType <sceneManager>();
        int I = 0;

        lockedState = win;
        if (lockedState == true)
        {
            winBtn.SetActive(true);
            failBtn.SetActive(false);
        }
        else
        {
            failBtn.SetActive(true);
            winBtn.SetActive(false);
        }
        StartCoroutine(drainScore());

        //wut is this for?
        while (I > igUi.Length)
        {
            igUi[I].SetActive(false); I++;
        }
    }
Exemple #14
0
    void OnTriggerEnter(Collider other)
    {
        // Check for the asteroid
        if (other.gameObject.tag == "enemy1")
        {
            // Create explosion on impact
            Instantiate(explosion, transform.position, transform.rotation);
            AudioSource.PlayClipAtPoint(e1death, transform.position);

            // Tell scene manager that we destroyed an enemy -> add score
            sceneManager scenem = oursceneManager.GetComponent <sceneManager>();
            sceneManager.numEnemies--;
            sceneManager.numKilled++;
            scenem.AddScore();

            Destroy(other.gameObject);


            // other.GetComponent("script name").variable etc
            //print (sceneManager.numEnemies);

            Destroy(gameObject);
        }
    }
Exemple #15
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     manager = this;
 }
Exemple #16
0
 void Start()
 {
     s = this;
 }
Exemple #17
0
 void Start()
 {
     sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <sceneManager>();
 }
Exemple #18
0
 // Use this for initialization
 void Start()
 {
     call = this;
 }
 // Use this for initialization
 void Start()
 {
     scene = GameObject.FindObjectOfType <sceneManager> ();
     audio = this.GetComponent <AudioSource> ();
 }
 private void Start()
 {
     sceneManager = FindObjectOfType <sceneManager>();
 }
Exemple #21
0
 // Start is called before the first frame update
 void Start()
 {
     manager = GetComponent <sceneManager>();
     // rend.material.SetColor(Color.white);
 }