Esempio n. 1
0
 private void UnSelectCurrent()
 {
     if (mSelectedSphere != null)
     {
         mSelectedSphere.GetComponent <Renderer>().material.color = Color.blue;
         mSelectedSphere = null;
     }
 }
Esempio n. 2
0
    public void SelectObjectAt(GameObject obj, Vector3 p)
    {
        // 1. unselect the current
        UnSelectCurrent();

        if (obj.name == "CreationPlane")
        {
            GameObject o = GameObject.CreatePrimitive(PrimitiveType.Sphere);
            mSelectedSphere = o.AddComponent <ScalableSphere>();
            mSelectedSphere.SetSpherePosition(p);
        }
        else
        {
            mSelectedSphere = obj.GetComponent <ScalableSphere>();
            Debug.Assert(mSelectedSphere != null);
        }
        SetSelectedColor();
    }