Пример #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();
    }
Пример #2
0
 void OnMouseDown()
 {
     SelectedObjectsScript.Select(gameObject);
 }
Пример #3
0
 void OnMouseDown()
 {
     Debug.Log("clicked stuff");
     SelectedObjectsScript.Select(gameObject);
     playerGroup.GetComponent <ModuleGroup> ().showAPs();
 }