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(); }
void OnMouseDown() { SelectedObjectsScript.Select(gameObject); }
void OnMouseDown() { Debug.Log("clicked stuff"); SelectedObjectsScript.Select(gameObject); playerGroup.GetComponent <ModuleGroup> ().showAPs(); }