Note that there are some explanatory texts on larger screens.

plurals
  1. POMouse over color picker and moving object
    primarykey
    data
    text
    <p>I have a color picker that appears only when i click on another gui texture button. also i have an object that has a rotating script behind it. how can i tell the object to not rotate when i am using the color picker ?</p> <p>This is the rotating script.</p> <pre><code>function LateUpdate () { if (isCameraInputIgnored() ) { return; } if (target &amp;&amp; Input.GetMouseButton(0)) { x += Input.GetAxis("Mouse X") * xSpeed * 0.02; y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02; y = ClampAngle(y, yMinLimit, yMaxLimit); var rotation = Quaternion.Euler(y, x, 0); var position = rotation * Vector3(0.0, 10.0, -distance) + target.position; transform.rotation = rotation; transform.position = position; } } </code></pre> <p>This function returns true if the mouse is over the 2 always present guitextures.</p> <pre><code>function isCameraInputIgnored () : boolean { var mousePos : Vector3 = Input.mousePosition; // invert the y-coordinate mousePos.y = Screen.height - mousePos.y; if ( tilesBlock.Contains(mousePos) || wallBlock.Contains(mousePos)) return true; return false; //if mouse isn't over gui's } Declaration : private var tilesBlock : Rect = Rect(0,0,570,182) ; //tiles rectangle private var wallBlock : Rect = Rect(670,0,590,172) ; //walls rectangle </code></pre> <p>In the LateUpdate functon i use this code to not rotate my object :</p> <pre><code>if (isCameraInputIgnored() ) { return; } </code></pre> <p>My problem is that after one of the second gui texture buttons is pressed a color picker appear that is declares like a GuiLayout.BeginArea(Rect) and when i drag my mouse through color my house is movng and changing colors at the same time. I want my house fixed when i am using the color picker.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload