mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-14 13:45:10 +00:00
a59713d4ef
* sprites1 * papapapunch * dancers sheet done * crop stomp * Particulate * Added veggie bag and particle to crop stomp, wip though * Space dance scrolling background has been added * cool * Canvas Scroll hype * Canvas scroll implemented in space soccer * 4k * gramps wip * more * assbun conflict fixed + long hair fix * Space dance bop modernization and fixes * ok * sprites done * wait. * fixed space dance stuff * Made miss return to idle * catchy tune 3 * epic --------- Co-authored-by: ev <85412919+evdial@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com>
29 lines
874 B
C#
29 lines
874 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace HeavenStudio.Common
|
|
{
|
|
public class CanvasScroll : MonoBehaviour
|
|
{
|
|
[SerializeField] RawImage[] _imgs;
|
|
|
|
public float NormalizedX = 0.0f;
|
|
public float NormalizedY = 0.0f;
|
|
public Vector2 Normalized { get { return new Vector2(NormalizedX, NormalizedY); } set { NormalizedX = value.x; NormalizedY = value.y; } }
|
|
|
|
public float TileX = 1.0f;
|
|
public float TileY = 1.0f;
|
|
public Vector2 Tile { get { return new Vector2(TileX, TileY); } set { TileX = value.x; TileY = value.y; } }
|
|
|
|
private void Update()
|
|
{
|
|
foreach (var img in _imgs)
|
|
{
|
|
img.uvRect = new Rect(new Vector2(NormalizedX, NormalizedY) * Tile, img.uvRect.size);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|