예제 #1
0
    // 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判定用のダミー
    }
예제 #2
0
    // 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;
    }
예제 #3
0
    // Update is called once per frame
    void Update()
    {
        string nowOil = MoveCarsor.getOil().ToString();

        text.text = nowOil + " / 100";
    }