I have this GUI prints out numbers of objects i select and rather than printing this i want to print out object name on it. How do i do this please help me
using UnityEngine;
using System.Collections;
namespace SimpleSelect
{
public class TestGUI : MonoBehaviour
{
private Rect labelRect = new Rect(5, 5, 250, 25);
void Update()
{
if(Input.GetKeyDown("d"))
{
GameObject[] obj = Selections.GetSelectedObjects();
for(int i = 0; i < obj.Length; i++) GameObject.Destroy(obj[i]);
}
}
void OnGUI()
{
GUI.Box(this.labelRect, "You selected " + Selections.GetSelectionCount() + " of " + Selections.GetSelectableCount() + " objects!");
}
}
}