Ejemplo n.º 1
0
    void OnMouseDown()
    {
        Debug.Log("Clicked player");
        List <GameObject> currentObjects = SelectedObjectsScript.GetSelectedObjects();

        if (currentObjects.Count == 1)
        {
            Debug.Log("Only one object selected, attaching");
            FixedJoint joint = gameObject.AddComponent <FixedJoint> ();
            joint.connectedBody = currentObjects[0].GetComponent <Rigidbody> ();

            // increase mass
            gameObject.GetComponent <Rigidbody> ().mass += 1;
        }
        SelectedObjectsScript.Clear();
    }
Ejemplo n.º 2
0
 void OnMouseDown()
 {
     SelectedObjectsScript.Select(gameObject);
 }
Ejemplo n.º 3
0
 void OnMouseDown()
 {
     Debug.Log("clicked stuff");
     SelectedObjectsScript.Select(gameObject);
     playerGroup.GetComponent <ModuleGroup> ().showAPs();
 }