예제 #1
0
파일: Enemy_T01.cs 프로젝트: nova666/I-HERO
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Attack_Area")
        {
            enemy.Chase = false;
            enemy.Animation_Controller.TriggerAttack();
        }

        if (other.gameObject.tag == "Enemy_T01" || other.gameObject.tag == "VFX")
        {
            if (other.gameObject.tag == "VFX")
            {
                UIController.IncreaseScore(scoreValue);
                ScoreMark.SpawnScoreMark(scoreValue, gameObject);
                VFXManager.SpawnConfetti(transform);
                SoundManager.PlaySFX("Die", transform);
            }
            if (other.gameObject.tag == "Enemy_T01")
            {
                VFXManager.SpawnConfetti(transform);
                SoundManager.PlaySFX("Despawn", transform);
            }


            Destroy(gameObject);
        }
    }
예제 #2
0
파일: Enemy_T03.cs 프로젝트: nova666/I-HERO
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "RotationPos")
        {
            transform.parent = other.gameObject.transform;
            other.gameObject.GetComponent <Collider>().enabled = false;
        }
        else if (other.gameObject.name == "Attack_Area")
        {
            if (enemy.Chase)
            {
                enemy.Chase  = false;
                enemy.Escape = true;
            }
        }

        if (other.gameObject.tag == "Enemy_T03" || other.gameObject.tag == "VFX")
        {
            if (other.gameObject.tag == "VFX")
            {
                UIController.IncreaseScore(scoreValue);
                ScoreMark.SpawnScoreMark(scoreValue, gameObject);
            }

            VFXManager.SpawnConfetti(transform);
            SoundManager.PlaySFX("Die", transform);
            Destroy(gameObject);
        }
    }
예제 #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Crystal")
        {
            return;
        }

        if (gameObject.tag == "InteractiveObject" && other.gameObject.tag == "VFX")
        {
            VFXManager.SpawnConfetti(transform);
            SoundManager.PlaySFX("Item", transform);
            ScoreMark.SpawnScoreMark((int)ScoreValue.Coin, gameObject);
            Destroy(gameObject);
        }
    }
예제 #4
0
    /// <summary>
    /// Spawn a label with the given text on the given target
    /// </summary>
    public void ScoreMark(string text, Color color, GameObject target, float duration, Vector3 offset)
    {
        ScoreMark mark = NGUITools.AddChild(gameObject, scoreMarkPrefab.gameObject).GetComponent <ScoreMark>();

        mark.InitScoreMark(text, color, target, duration, offset);
    }