Files
Project-M/Assets/Synty/InterfaceSciFiSoldierHUD/Samples/Scripts/SampleScrollUV.cs
T
kronic 5a59d8e14f Add Synty asset packs (enemies + environment/FX/UI) via Git LFS
14 newly-imported Synty Polygon packs (~2.46 GB; FBX/PNG/textures stored in
Git LFS per .gitattributes). Enemy-grade characters: Werewolf, Kaiju,
FantasyHeroCharacters, Vikings, Western, HorrorCarnival, Dog. Environment:
Nature, NatureBiomes, PNB_Core, FantasyKingdom. UI/icons: Icons,
InterfaceCore, InterfaceSciFiSoldierHUD.

Werewolf + Kaiju back the DR-023 animated enemies; the rest are cataloged
for future work in Docs/Vault/06_Roadmap/Synty_Asset_Inventory.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 23:28:47 -07:00

51 lines
1.5 KiB
C#

// Copyright (c) 2024 Synty Studios Limited. All rights reserved.
//
// Use of this software is subject to the terms and conditions of the Synty Studios End User Licence Agreement (EULA)
// available at: https://syntystore.com/pages/end-user-licence-agreement
//
// Sample scripts are included only as examples and are not intended as production-ready.
using UnityEngine;
using UnityEngine.UI;
namespace Synty.Interface.SciFiSoldierHUD.Samples
{
/// <summary>
/// Animates the UVs of a raw image for a scrolling background effect.
/// </summary>
public class SampleScrollUV : MonoBehaviour
{
[Header("References")]
public RawImage rawImage;
[Header("Parameters")]
public Vector2 speed = new Vector2(1, 0);
public Vector2 size = new Vector2(256, 256);
private void Awake()
{
if (rawImage == null)
{
rawImage = GetComponent<RawImage>();
}
}
private void Reset()
{
rawImage = GetComponent<RawImage>();
}
private void Update()
{
Vector2 calculatedSizeBasedOnScreen = new Vector2(
rawImage.rectTransform.rect.width / size.x,
rawImage.rectTransform.rect.height / size.y
);
rawImage.uvRect = new Rect(
rawImage.uvRect.position + (speed * Time.deltaTime),
calculatedSizeBasedOnScreen
);
}
}
}