コード例 #1
0
    IEnumerator MoveMenu(object[] obj)
    {
        SelectMenu    menu   = obj[0] as SelectMenu;
        float         yValue = (float)obj[1];
        RectTransform tr     = menu.GetComponent <RectTransform>();
        Vector2       v2     = tr.anchoredPosition;

        v2.y = yValue;
        float f        = Time.deltaTime * 3;
        int   OneFrame = (int)(1f / f);

        for (int i = 0; i < OneFrame; i++)
        {
            tr.anchoredPosition = Vector2.Lerp(tr.anchoredPosition, v2, f * 2.5f);
            yield return(null);
        }
    }