// Update is called once per frame void Update() { currentTimeToInstantiate += Time.deltaTime; if (currentTimeToInstantiate > randomTime && !EndGameWritting.GetIsIn()) { Create(); currentTimeToInstantiate = 0; } }
// Update is called once per frame void Update() { currentTimeAlive += Time.deltaTime; if (currentTimeAlive >= 10f) { Destroy(gameObject); } transform.Translate(Vector2.up * moveSpeed * Time.deltaTime); if (EndGameWritting.IsGameEnded()) { Destroy(gameObject); } }
// Update is called once per frame void Update() { currentTimePlaying += Time.deltaTime; if (currentTimePlaying >= 0.5f && !EndGameWritting.GetIsIn()) { foreach (Touch t in Input.touches) { if (t.phase == TouchPhase.Began) { TestClick(Camera.main.ScreenToWorldPoint(t.position)); } } if (Input.GetMouseButtonDown(0)) { Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); TestClick(pos); } } }
void Awake() { instance = this; }