void Start() { player = GameObject.FindGameObjectWithTag("Player"); player_statu = player.GetComponent <PlayerStatusScript>(); player_statu.AddDummyNow(1); timer = 0; }
// Update is called once per frame void Update() { timer += Time.deltaTime; if (timer > time_limit) { player_statu.AddDummyNow(-1); Destroy(this.gameObject); } }