The title is this, 3 cube is called a B C bar,
One of the points in the mouse color, such as the point of a, which becomes blue, then point in the other after the other blue, the object in the previous point, restore the original color,
I wrote the following code: I used the goto, although realized, but feel bad, some people say with recursion to do, seek guidance
Using unityengine;using System.collections; public class myscript:monobehaviour { Private Color tempcolor;//Object Colors Private Gameobject tempgame;//objects in the save point private bool tempbool=true;// Control change void Update () { Ray Ray = Camera.main.ScreenPointToRay (Input.mouseposi tion); Raycasthit hit; if (Physics.raycast (ray, out hits) &&in Put. Getmousebuttondown (0)) { Aa:;//goto statement jump tag &NBSP ; if (tempbool) { &NB Sp Debug.Log (tempbool); Tempgame = HIT.TRANSFORM.GAMEOBJ ect;//Objects Tempbool = false; &NBS P }   Else { Debug.Log (tempbool); &NBSP ; TempGame.renderer.material.color = tempcolor;//Last object color &NBS P Tempbool = true; Goto aa; } Tempcolor = hit.transform.gameObject.renderer.material.co lor;//Object Color Hit.transform.gameObject.renderer.material.color = color.blue;/ /Point object after blue }}}
Unity on machine-mouse click Cube color