コード例 #1
0
ファイル: ColorFade.cs プロジェクト: karakida/ZooGame
    void Update()
    {
        if (isFadeEnd)
        {
            return;
        }

        time += Time.deltaTime;
        float alpha = 1.0f;

        if (fadeType == FadeType.FADEIN)
        {
            alpha = easing.CubicIn(easing.DelayTime(time, 0.0f, takeTime), 1.0f, 0.0f);
        }
        else if (fadeType == FadeType.FADEOUT)
        {
            alpha = easing.CubicIn(easing.DelayTime(time, 0.0f, takeTime), 0.0f, 1.0f);
        }

        GetComponent <Image>().color = new Color(fadeColor.r, fadeColor.g, fadeColor.b, alpha);

        if (time >= takeTime)
        {
            isFadeEnd = true;
        }
    }
コード例 #2
0
ファイル: AnimalMover.cs プロジェクト: karakida/ZooGame
    private void Moving()
    {
        if (!isMove)
        {
            return;
        }

        moveTime += Time.deltaTime;
        float posY;

        if (moveTime < 0.5f)
        {
            posY = easing.CubicOut(easing.DelayTime(moveTime, 0.0f, 0.5f),
                                   originPosY,
                                   originPosY + jumpSpeed);
        }
        else
        {
            posY = easing.CubicIn(easing.DelayTime(moveTime, 0.5f, 0.5f),
                                  originPosY + jumpSpeed,
                                  originPosY);
        }


        transform.localPosition = new Vector3(
            transform.localPosition.x,
            posY,
            transform.localPosition.z);
        if (moveTime >= 1.0f)
        {
            moveTime = 0.0f;
            isMove   = false;
        }
    }
コード例 #3
0
ファイル: PeopleMover.cs プロジェクト: karakida/ZooGame
    private void Moving()
    {
        if (isMoveEnd)
        {
            return;
        }

        moveTime += Time.deltaTime;
        float pos_x = easing.Linear(easing.DelayTime(moveTime, 0.0f, moveTakeTimeList[moveCount]), start_pos.x, movePointList[moveCount].x);
        float pos_y = easing.Linear(easing.DelayTime(moveTime, 0.0f, moveTakeTimeList[moveCount]), start_pos.y, movePointList[moveCount].y);

        transform.localPosition = new Vector3(pos_x, pos_y, 0.0f);
        if (easing.DelayTime(moveTime, 0.0f, moveTakeTimeList[moveCount]) == 1.0f)
        {
            moveTime  = 0.0f;
            start_pos = movePointList[moveCount];
            moveCount++;
            if (moveCount >= movePointList.Count)
            {
                isMoveEnd = true;
            }
        }
    }
コード例 #4
0
ファイル: ResultManager.cs プロジェクト: karakida/ZooGame
    private void UpdateEasing()
    {
        if (isEasingEnd)
        {
            return;
        }

        time += Time.deltaTime;
        if (time > easingStart[easingStart.Count - 1] + easingTakeTime[easingTakeTime.Count - 1])
        {
            time = easingStart[easingStart.Count - 1] + easingTakeTime[easingTakeTime.Count - 1];
        }

        totalFoodCost = (int)easing.Linear(
            easing.DelayTime(time, easingStart[0], easingTakeTime[0]),
            0.0f,
            player.OneDayFoodCost);

        totalAnimalPurchaseCost = (int)easing.Linear(
            easing.DelayTime(time, easingStart[1], easingTakeTime[1]),
            0.0f,
            player.OneDayAnimalPurchaseCost);

        totalToyCost = (int)easing.Linear(
            easing.DelayTime(time, easingStart[2], easingTakeTime[2]),
            0.0f,
            player.OneDayToyCost);

        totalVisitors = (int)easing.Linear(
            easing.DelayTime(time, easingStart[3], easingTakeTime[3]),
            0.0f,
            player.OneDayVisitors);

        totalEntranceFee = (int)easing.Linear(
            easing.DelayTime(time, easingStart[4], easingTakeTime[4]),
            0.0f,
            player.entranceFee * player.OneDayVisitors);

        balanceOfPayments = (int)easing.Linear(
            easing.DelayTime(time, easingStart[5], easingTakeTime[5]),
            0.0f,
            totalEntranceFee - (totalFoodCost + totalAnimalPurchaseCost + totalToyCost));
    }