This repository has been archived on 2026-01-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Frontec/Assets/Scripts/WSH/WireRoller.cs
jmaniuvc 2936c48466 Frontec
2025-02-24 12:12:52 +09:00

29 lines
761 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace WSH.Animator
{
public class WireRoller : MonoBehaviour
{
[Range(0, 120f)]
public float speed;
[SerializeField] Transform[] rollers;
private void Awake()
{
rollers = GetComponentsInChildren<Transform>().Where(g => g.CompareTag(Tags.Roll.ToString())).ToArray();
}
private void Update()
{
var value = Time.deltaTime * speed;
foreach (var roller in rollers)
{
var rot = roller.rotation.eulerAngles;
rot.z += value;
roller.rotation = Quaternion.Euler(rot);
}
}
}
}