Exemplo n.º 1
0
    private void OnCollisionEnter(Collision collision)
    {
        // Way = new Vector3(0, 0, 0);
        Touch TouchScript = GameObject.Find("TouchManager").GetComponent <Touch>();

        TouchScript.SetStartAndEnd(this.gameObject, collision.gameObject);
        //     TouchScript.setStartMoveWay(Way);
        TouchScript.CreateSlime(this.gameObject.tag);
        Debug.Log(this.gameObject.tag + "=============================================================");
        Destroy(collision.gameObject.transform.parent.gameObject);

        Destroy(this.transform.parent.gameObject);

        //foreach (ContactPoint contactPoint in collision.contacts)
        //{


        //}
    }
Exemplo n.º 2
0
    private void OnCollisionEnter(Collision collision)
    {
        // Way = new Vector3(0, 0, 0);
        Touch TouchScript = GameObject.Find("TouchManager").GetComponent <Touch>();

        TouchScript.SetStartAndEnd(this.gameObject, collision.gameObject);
        //     TouchScript.setStartMoveWay(Way);
        TouchScript.CreateSlime(this.gameObject.tag);
        Debug.Log(this.gameObject.tag + "=============================================================");
        Destroy(collision.gameObject.transform.parent.gameObject);

        Destroy(this.transform.parent.gameObject);

        foreach (ContactPoint contactPoint in collision.contacts)
        {
            GameObject effect = (GameObject)Instantiate(BigExplosion, (Vector3)contactPoint.point, Quaternion.identity);

            Destroy(effect, 0.5f);
        }
    }