mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
[PropSpawnTweaks] Initial builds
This commit is contained in:
parent
e2e4463663
commit
cafd24bd2f
9 changed files with 402 additions and 0 deletions
32
PropSpawnTweaks/Components/PropLoadingHexagon.cs
Normal file
32
PropSpawnTweaks/Components/PropLoadingHexagon.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace NAK.PropSpawnTweaks.Components;
|
||||
|
||||
public class PropLoadingHexagon : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private SkinnedMeshRenderer _hexRenderer;
|
||||
[SerializeField] private TMPro.TextMeshPro _loadingText;
|
||||
[SerializeField] private Transform[] _hexTransforms;
|
||||
private float _scale;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_scale < 1f)
|
||||
{
|
||||
_scale += Time.deltaTime * 4f;
|
||||
transform.GetChild(0).localScale = Vector3.one * _scale;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
// give slightly different rotation to each hexagon
|
||||
_hexTransforms[i].Rotate(Vector3.up, 30f * Time.deltaTime * (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetLoadingText(string text)
|
||||
=> _loadingText.text = text; // SetAllDirty
|
||||
|
||||
public void SetLoadingShape(float value)
|
||||
=> _hexRenderer.SetBlendShapeWeight(0, value);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue