void Collect() { SFXManager.PlayClip(collectSFX); SoulWallet.CollectSoul(this); gameObject.SetActive(false); //Destroy(this.gameObject); }
public void ConfirmPurchase() { SFXManager.PlayCoinClip(); SoulWallet.SpendSouls(itemCost); UnlockTable.UnlockPower(unlockID); SetSkillActive(true); purchased = true; for(int i = 0; i < 3; i++){ uiNumbers[i].SetEnabled(false); } }
public void TakeDamage() { if (hitstun || dashPauseTimer > 0) { return; } //Debug.Log("ow!"); int soulsLost = SoulWallet.LoseSouls(); if (soulsLost < 0) { Die(); } else { int soulSpawns = 1; if (soulsLost < 5) { soulSpawns = soulsLost; } else if (soulsLost < 30) { soulSpawns = (soulsLost / 2) + 3; } else { soulSpawns = 15; } for (int i = 0; i < soulSpawns; i++) { SoulCollectible soul = Instantiate(GameController.instance.soulPrefab); soul.transform.position = transform.position; Vector3 launchVel = new Vector3(0, 4); launchVel.x = Random.Range(-6, 6); launchVel.y += Random.Range(0, 8); soul.SetLaunchVelocity(launchVel); } } hitstun = true; _rigidbody.velocity = new Vector3(-2f * _anim.Facing, 1, 0); _anim.PlayHurtAnim(); }
public void ResetGame() { player.Anim.SetPalette(0); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); SoulWallet.Reset(); }