Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Test : MonoBehaviour
- {
- [SerializeField] private AnimationCurve spawnCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
- private int hour;
- private float spawnMultiplier;
- private void Start()
- {
- InvokeRepeating(nameof(UpdateTime), 1f, 1f);
- }
- private void UpdateTime()
- {
- hour = (int)Mathf.Repeat(hour + 1, 24);
- spawnMultiplier = spawnCurve.Evaluate(hour / 24f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement