// Update is called once per frame void Update() { if (startWish) { switch (wishCurrent) { case WishCurrent.START: WishStart(); wishCurrent = WishCurrent.UPDATE; break; case WishCurrent.UPDATE: WishUpdate(); wishTimer += Time.deltaTime; if (wishTimer >= wishTime) { wishCurrent = WishCurrent.END; } break; case WishCurrent.END: startWish = false; WishEnd(); wishTimer = 0; wishCurrent = WishCurrent.START; WishManager.isWishNow = false; break; } } }
// Start is called before the first frame update void Start() { wishCurrent = WishCurrent.START; wishTimer = 0; isWishEnd = false; startWish = false; }