mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 21:47:39 +02:00
Space Dance and Crop Stomp visual improvements + canvasScroll (#450)
* 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>
This commit is contained in:
29
Assets/Scripts/Common/CanvasScroll.cs
Normal file
29
Assets/Scripts/Common/CanvasScroll.cs
Normal file
@ -0,0 +1,29 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user