示例#1
0
    private void OnTriggerStay2D(Collider2D col)
    {
        if (col.tag == "ScraulShit")
        {
            ScraulShitBehaviour scraulShit = col.GetComponent <ScraulShitBehaviour> ();

            if (Input.GetKeyDown(KeyCode.J))
            {
                scraulShit.Hit();
            }
        }
    }
示例#2
0
    private void EnableShits()
    {
        Transform           shits      = GameObject.Find("Shits").transform;
        float               shitsCount = shits.childCount;
        ScraulShitBehaviour scraulShit = null;;

        for (int i = 0; i < shitsCount; i++)
        {
            scraulShit            = shits.GetChild(i).GetComponent <ScraulShitBehaviour> ();
            scraulShit.OnDestroy += this.ScraulShitDestroyed;
            scraulShits.Add(scraulShit);
        }
    }
示例#3
0
 private void ScraulShitDestroyed(ScraulShitBehaviour scraulShit)
 {
     scraulShit.OnDestroy -= this.ScraulShitDestroyed;
     this.scraulShits.Remove(scraulShit);
     this.OnShitDestroyed();
 }