public void MakeACall() { if (!phoneBroken) { callReader.RandomisePhrase(); PutinText.text = callReader.GetCurrentPutin(); TrampText.text = callReader.GetCurrentTramp(); barControl.ChangeBar(-5.0f, "a"); phoneCount++; if (phoneCount > 15) { phoneBroken = true; } } }
// Update is called once per frame void Update() { float m = MOVE_SPEED * Time.deltaTime; float speed = m * cRect.rect.width * cRect.localScale.x; tRect.transform.Translate(Vector3.left * speed, Space.Self); if (tRect.transform.position.x < cRect.transform.position.x - cRect.rect.width * cRect.localScale.x * 0.5f - tRect.rect.width * .5f * cRect.localScale.x || newCyle.IsNewCycleStayTooLong()) { isTVDone = true; if (tRect.transform.position.x < cRect.transform.position.x - cRect.rect.width * cRect.localScale.x * 0.5f - tRect.rect.width * .65f * cRect.localScale.x) { tRect.transform.position = startPos; } } else { isTVDone = false; } if (Input.GetKeyDown(KeyCode.Space)) { SwitchChannel(); Debug.Log(channelNum); } /*else if (Input.GetKeyDown(KeyCode.U)) * { * UpdateChannel("CNN", "F**k Trump!", Channel.Trump.CON); * }*/ remoteTime += Time.deltaTime; obstructTime += Time.deltaTime; if (remoteTime > 10.0f) { if (remoteCount > 0) { if (remoteBroken) { remoteBroken = false; remoteCount = 0; } else { remoteCount--; } } remoteTime = 0; } //TODO : WTF IS THIS !!!! //if (obstructTime >= obstruct) //{ // bool isCon = false; // for (int i = 0; i < tvChannels.Count; i++) // { // if (tvChannels[channelNum].side == Channel.Trump.CON) // { // isCon = true; // break; // } // } // if (tvChannels[channelNum].side != Channel.Trump.CON && isCon) // { // do // { // Debug.Log("runn"); // SwitchChannel(); // } while (tvChannels[channelNum].side != Channel.Trump.CON); // } // obstruct = Random.Range(10.0f, 15.0f); // obstructTime = 0; //} SwitchChannelIfStayToLongOnPro(5); if (newCyle.IsNewCycleStayTooLong()) { isTVDone = true; } if (tvChannels [channelNum].side == Channel.Trump.CON) { barControl.ChangeBar(0.15f, "a"); } else if (tvChannels [channelNum].side == Channel.Trump.PRO) { barControl.ChangeBar(-0.075f, "a"); } else { barControl.ChangeBar(0, "a"); } foreach (Channel c in tvChannels) { //Debug.Log(c.channelName + " " + c.side); } }