// Start is called before the first frame update void Start() { rect = GetComponent <RectTransform>(); nowOil = MoveCarsor.getOil(); var pos = rect.anchoredPosition + new Vector2(0, Screen.height * nowOil / 100f); rect.anchoredPosition = pos; PreviousOil = nowOil;//Update最初のif判定用のダミー }
// Update is called once per frame void Update() { nowOil = MoveCarsor.getOil(); if (nowOil != PreviousOil) { var pos = rect.anchoredPosition + new Vector2(0, Screen.height * (nowOil - PreviousOil) / 100); rect.anchoredPosition = pos; } PreviousOil = nowOil; }
// Update is called once per frame void Update() { string nowOil = MoveCarsor.getOil().ToString(); text.text = nowOil + " / 100"; }
// Update is called once per frame void Update() { string nowMoney = MoveCarsor.getMoney().ToString(); text.text = "所持金:" + nowMoney + "G"; }
void Start() { MoveCarsor = GameObject.Find("Icon"); script = MoveCarsor.GetComponent <MoveCarsor>(); }
// Update is called once per frame void Update() { string nowJewels = MoveCarsor.getJewels().ToString(); text.text = "x " + nowJewels; }
void Start() { icon = GameObject.Find("Icon"); script = icon.GetComponent <MoveCarsor>(); }