Ejemplo n.º 1
0
    public override void Die()
    {
        //reset data
        Freezable f = GetComponent <Freezable>();

        if (f != null)
        {
            f.Unfreeze();
        }

        SpawnPoint[] spawnPoints = GameObject.FindObjectsOfType <SpawnPoint>();
        foreach (SpawnPoint point in spawnPoints)
        {
            point.ResetSpawn();
        }

        foreach (PotionSelector.PotionElement potionElement in PotionSelector.GetAllPotionElements())
        {
            potionElement.SetCount(0);
        }

        Vector3 checkPointPosition = CheckPointManager.GetCheckPointPos();

        transform.position = new Vector3(checkPointPosition.x, checkPointPosition.y, transform.position.z);

        foreach (SpawnPoint point in spawnPoints)
        {
            point.SpawnAll();
        }

        currentHealth = maxHealth;
        HealthSlider.SetValue(1f);
    }