예제 #1
0
    private IEnumerator PlayerHitChechpointCo(int Bonus)
    {
        Floating_Text.Show("CheckPoint", "CheckPointText", new Centered_Text_Positioner(.5f));
        yield return(new WaitForSeconds(.5f));

        Floating_Text.Show(string.Format("+{0}! Time Bonus!", Bonus), "Check Point Text", new Centered_Text_Positioner(.5f));
    }
예제 #2
0
    public void TakeDamage(float Damage)
    {
        Floating_Text.Show(string.Format("-{0}!", Damage), "DamageText", new From_WorldPoint_Text_Positioner(Camera.main, transform.position, 25f, 60f));

        Instantiate(DamageEffect, transform.position, transform.rotation);
        Health -= Damage;
        if (Health <= 0)
        {
            Level_Manager.Instance.KillPlayer();
        }
    }
예제 #3
0
    public void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <Player>() == null)
        {
            return;
        }

        Game_Manager.Instance.AddPoints(points);
        Instantiate(Effect, transform.position, transform.rotation);
        gameObject.SetActive(false);

        Floating_Text.Show(string.Format("+{0}!", points), "Item Text", new From_WorldPoint_Text_Positioner(Camera.main, transform.position, 1.5f, 50f));
    }
예제 #4
0
    public void TakeDamage(int damage, GameObject instigator)
    {
        if (PointValue != 0) //change this if you want to award a negative score to a player
        {
            var projectile = instigator.GetComponent <Projectile>();

            if (projectile != null && projectile.Owner.GetComponent <Player>() != null)
            {
                Game_Manager.Instance.AddPoints(PointValue);
                Floating_Text.Show(string.Format("+{0}!", PointValue), "Points Item", new From_WorldPoint_Text_Positioner(Camera.main, transform.position, 1.5f, 50f));

                DestroyProjectile();
            }
        }
    }
예제 #5
0
    public void TakeDamage(int damage, GameObject instigator)
    {
        Health -= damage;

        if (Health <= 0)
        {
            Instantiate(DestroyedEffect, transform.position, transform.rotation);
            gameObject.SetActive(false);
        }

        if (PointstoGive != 0)
        {
            var projectile = instigator.GetComponent <Projectile> ();
            Floating_Text.Show(string.Format("+{0}!", PointstoGive), "PointstarText", new From_WorldPoint_Text_Positioner(Camera.main, transform.position, 1.5f, 50));
        }
    }