Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        timerSelfDestruct = Time.time;

        TimersManager.SetLoopableTimer(this, 0.5f, rotacionar);

        transform.LookAt(player.transform);
    }
Exemple #2
0
    void Start()
    {
        m_PointLight = gameObject.GetComponent <Light>();

        // set a timer that calls ChangeIntensity() every 0.1 seconds
        TimersManager.SetLoopableTimer(this, 0.1f, ChangeIntensity);
        TimersManager.SetTimer(this, 5f, delegate { Destroy(this); });
    }
    // Start is called before the first frame update
    void Start()
    {
        timerSelfDestruct = Time.time;

        if (!player || player == null)
        {
            player = GameObject.FindGameObjectWithTag("Player");
        }

        TimersManager.SetLoopableTimer(this, 2f, shootAt);
    }
 public void timerSetting()
 {
     gameTrigger = true;
     foreach (var towers in  TowerManager.Instance.towers)
     {
         towers.shootOnce();
         towers.target = TowerManager.Instance.enemyGround.tileArr[Random.Range(0, 24)].transform;
     }
     activeCount = m_activeCount;
     UIManager.Instance.moveCountChange(m_activeCount);
     UIManager.Instance.timerCount = timerCount;
     TimersManager.SetLoopableTimer(this, 1f, UIManager.Instance.timeCount);
     TimersManager.SetPaused(UIManager.Instance.timeCount, false);
 }
Exemple #5
0
    // Start is called before the first frame update
    void Start()
    {
        textoHp = GameObject.Find("HpP" + id).GetComponent <TextMeshProUGUI>();

        gameRef = GameObject.FindGameObjectWithTag("Game").GetComponent <Game>();

        sfxRef = GameObject.Find("SFX").GetComponent <Sfx>();

        corInicial = GetComponent <Renderer>().material.color;

        powerUp = new Timer(0.1f, (uint)(powerUpDuration / 0.1), absolutelyNotSuperStar);

        TimersManager.SetLoopableTimer(this, 5f, hpRegen);
    }
Exemple #6
0
    // Start is called before the first frame update
    private void Start()
    {
        Hp = maxHp;

        if (!game_ref || game_ref == null)
        {
            game_ref = GameObject.FindGameObjectWithTag("Game").GetComponent <Game>();
        }

        if (!rigidbody_ref || rigidbody_ref == null)
        {
            rigidbody_ref = GetComponent <Rigidbody2D>();
        }

        scoreTimer = Time.time;

        TimersManager.SetLoopableTimer(this, 1f, increaseScore);
    }
    // Start is called before the first frame update
    void Start()
    {
        menu = GameObject.FindGameObjectWithTag("Menu").GetComponent <Menu>();
        menu.gameObject.SetActive(false);

        players = new Player[PlayerPrefs.GetInt("playerQuantity")];

        for (int i = 0; i < PlayerPrefs.GetInt("playerQuantity"); i++)
        {
            if (i >= playersPrefabs.Length)
            {
                break;
            }

            Player p = Instantiate(playersPrefabs[i], new Vector3(2 * i, (float)0.5, 0), Quaternion.identity).GetComponent <Player>();

            p.id = i + 1;

            if (PlayerPrefs.GetInt("peopleInTeamOne") > 0)
            {
                p.time = 1;
                PlayerPrefs.SetInt("peopleInTeamOne", PlayerPrefs.GetInt("peopleInTeamOne") - 1);
            }
            else
            {
                p.time = 2;
            }

            players[i] = p;
        }

        TimersManager.SetLoopableTimer(this, enemyTimeRate, spawnInimigo);
        TimersManager.SetLoopableTimer(this, scoreTimeRate, scoreRate);
        TimersManager.SetLoopableTimer(this, powerUpTimeRate, spawnPowerUp);
        //----------
        TimersManager.SetTimer(this, scoreTimer);
        TimersManager.ClearTimer(EmptyTimer);

        lastDamageTakenTime = Time.time;
    }
 // Start is called before the first frame update
 void Start()
 {
     TimersManager.SetLoopableTimer(this, 0.15f, changeColor);
 }