the while statement is looking for a true or false, thus it is saying you cannot convert a constant (1) to a true or false. 1 is always 1.
you may be better having a boolean variable called isBlinking and set that to true or false, then you can use while(isBlinking) or while(!isBlinking) depending on what you want.
incidentally, there are better ways of doing this, look up “delays”
Here :
using UnityEngine;
using System.Collections;
public class WarningText : MonoBehaviour {
GUIStyle style = new GUIStyle();
private bool textBlinking = false;
Rect rect;
float delay = 0.2f;
float currentDelay;
void Start() {
rect = new Rect(0, 0, Screen.width/2, Screen.height/2);
style.fontSize = 40;
GUI.color = Color.red;
currentDelay = Time.time + delay;
}
void Update()
{
if (Time.time > currentDelay)
{
currentDelay = Time.time + delay;
if(textBlinking)
{
textBlinking = false;
}
else if(!textBlinking)
{
textBlinking = true;
}
}
}
void OnGUI()
{
if(textBlinking)
{
GUI.Label(rect,"STAY AWAY FROM GHOSTS!", style);
}
}
}