Exemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         dedanimation script = dedguy.GetComponent <dedanimation>();
         script.isded = 1;
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        pos = transform.position;
        gameObject.transform.position = pos;

        if (pos.x > 9)
        {
            dedanimation script = dedguy.GetComponent <dedanimation>();
            script.isded = 1;
        }
    }