HeavenStudio/Assets/Scripts/Common/CanvasScroll.cs
Rapandrasmus dfe144cf4b
Games fixes/reworks patch (#501)
* ghosts are scaled now

* Lockstep fully reworked

* mr. bach has been implemented

* Space dance fixes

* oops

* Tap trial rework part 1

* tap trial rework part 2

* oopsie

* Gramps Talk Update

* Space Dance Voice Offsets

* Giraffe done! (Except miss anim)

* bg is not showing up for some reason

* bg not rendering fixed + giraffe fixed

* scrolling done

* fixed space dance and space soccer bg scrolls

* fixed rockers bugs

* adjustment

* fixed el inaccuracies

* particle fix

* changed pitch and volume of monkey tap

* miss anim

* megamix face for girl

* Proper miss anim implementation

* Added force stepping event

* miss anim fix

---------

Co-authored-by: saladplainzone <chocolate2890mail@gmail.com>
Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
2023-07-13 00:35:47 +00:00

30 lines
847 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(Normalized * Tile, img.uvRect.size);
}
}
}
}