示例#1
0
 void OnCollisionEnter2D(Collision2D info)
 {
     if (!gen.dead && gen.deathFall)
     {
         print("ouch!");
         gen.dead      = true;
         gen.deathFall = false;
         gen.Invoke("CreateGhost", 1f);
     }
 }
示例#2
0
    void KillGhost(generalMovement gen)
    {
        rb.velocity = Vector3.zero;
        GetComponentInParent <ghostMovement>().canMove = false;
        GameObject ghostPart = Instantiate(particle, transform.position, transform.rotation) as GameObject;

        ghostPart.GetComponent <particleAttractor>().obj = gen.transform;
        gen.enabled = true;
        gen.dead    = false;
        gen.Invoke("GetUp", 2f);
        Camera.main.GetComponent <cameraMove>().player = gen.transform;
        Destroy(transform.parent.gameObject, 2f);
    }