示例#1
0
 IEnumerator decreaseUnrest()
 {
     while (true)
     {
         unrestController.IncreaseUnrest(-(Mathf.Abs((unrestController.decay * Time.deltaTime) / 2f)));
         yield return(new WaitForEndOfFrame());
     }
 }
示例#2
0
    IEnumerator NewHeadline(float delay)
    {
        while (true)
        {
            input.GetComponent <KayboardSelect> ().disableField();
            input.text = headlines [Random.Range(0, headlines.Length)];

            //reset the input
            yield return(new WaitForSeconds(delay));

            //check if a slanderous headline got through
            if (slanderousHeadlines.Contains(headline.text))
            {
                //increase unrest for the headline
                unrestController.IncreaseUnrest(unrestValue);
                cameraController.warning(newsCam);
            }
        }
    }
示例#3
0
 void Update()
 {
     //have we reached the top yet?
     if (transform.position.y - initialPos.y < wallHeight)
     {
         transform.localPosition += new Vector3(0, speed * Time.deltaTime, 0);
     }
     //have we moved across the top yet?
     else if (transform.position.x < initialPos.x + wallWidth)
     {
         transform.localPosition += new Vector3(speed * Time.deltaTime, 0, 0);
     }
     //yes we have
     else
     {
         unrestController.IncreaseUnrest(escapePenalty);
         cameraControl.warning(prisonCam);
         Destroy(gameObject);
     }
 }