Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.UI;
- public class CPUController : MonoBehaviour
- {
- Text MainPageText;
- Vector2 MainPageCoord;
- public float UIYCoord;
- void Start ()
- {
- MainPageText = transform.Find("CPUCanvas/Panel/Text").GetComponent<Text>();
- //MainPageText.text = "34553453453455434534534534583908530984520938450-2384523094852837589237523-523458273523845723-572-9759-23752-394572834752-934875";
- UIYCoord = -600.0f;
- //MovePageUp();
- }
- void Update ()
- {
- MainPageText.transform.localPosition = new Vector3(20.0f, UIYCoord, 0.0f);
- //UIYCoord += 20.3f * Time.deltaTime;
- // MainPageCoord = new Vector2(20.0f, UIYCoord);
- // MainPageText.rectTransform.anchoredPosition = MainPageCoord;
- // MainPageText.transform.localPosition = new Vector3(20.0f, UIYCoord, 0.0f);
- if (Input.GetKey(KeyCode.P))
- {
- MovePageUp();
- }
- }
- public void MovePageUp()
- {
- StartCoroutine(PageMoveUp());
- }
- IEnumerator PageMoveUp()
- {
- {
- while (MainPageText.transform.localPosition.y < 600.0f)
- {
- UIYCoord += 70.0f * Time.deltaTime;
- yield return null;
- }
- UIYCoord = -600.0f;
- //MainPageText.transform.localPosition = new Vector3(20.0f, -600.0f, 0.0f);
- Debug.Log("Верхний предел");
- // MovePageUp();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement