Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        flyingBall = FindObjectOfType <FlyingBall>();
        Debug.Log(col.gameObject.name + " : " + gameObject.name + " : " + Time.time);
        MouseDragAndDrop go = col.gameObject.GetComponent <MouseDragAndDrop>();

        go.dropped  = true;
        go.dragging = false;

        if (go.rigidBody1 != null)
        {
            flyingBall.dropObject(go.rigidBody1.mass);
            Debug.Log(go.rigidBody1.mass);
        }
        InspectorObject inspector = FindObjectOfType <InspectorObject>();

        inspector.dropObject(go.rigidBody1.mass);
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        MouseDragAndDrop drag = GetComponent <MouseDragAndDrop>();


        if (drag.dragging != on)
        {
            on = drag.dragging;
            if (on)
            {
                LighterOn();
            }
            else
            {
                LighterOff();
            }
        }
    }
Exemplo n.º 3
0
    void OnTriggerEnter2D(Collider2D col)
    {
        Debug.Log("Tentacle " + col.gameObject.name.ToString());
        MouseDragAndDrop col_mdnd = col.gameObject.GetComponent <MouseDragAndDrop>();

        if (!col_mdnd.isTentacled)
        {
            col_mdnd.isTentacled = true;
            Rigidbody2D col_rb = col.gameObject.GetComponent <Rigidbody2D>();
            col_rb.gravityScale = 0;
            col_rb.velocity    *= 0.0f;
            col_rb.rotation    *= 0.0f;

            obj    = col.gameObject;
            isUp   = false;
            isDown = true;

            Boss boss = FindObjectOfType <Boss>();
            boss.DeleteTentacle();
        }
    }