Пример #1
0
    void Glitch()
    {
        float distance = Vector3.Distance(monster.position, transform.position);

        if (distance < monsterDistance)
        {
            glitch.GetComponent <GlitchEffect>().enabled = true;
        }
        else
        {
            glitch.GetComponent <GlitchEffect>().enabled = false;
        }
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     glitch = GetComponent <GlitchEffect>();
     glitch.GetComponent <GlitchEffect>().enabled = false;
 }