示例#1
0
    public void ApplyDamage(float damage)
    {
        currentHealth -= damage;

        if (currentHealth <= 0)
        {
            FXGenerator.GroundExplosion(transform.position);
            Destroy(gameObject);
        }
    }
示例#2
0
文件: Dagger.cs 项目: Raffa78/Gods
 private void OnTriggerEnter2D(Collider2D collision)
 {
     FXGenerator.Hit(transform.position);
     collision.GetComponentInParent <RunningCharacter>().ApplyDamage(1.0f);
     Destroy(gameObject);
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }