- Assets/_Game/ 하위로 게임 에셋 통합 - External/ 패키지 벤더별 분류 (Synty, Animations, UI) - 에셋 네이밍 컨벤션 확립 및 적용 (Data_Skill_, Data_SkillEffect_, Prefab_, Anim_, Model_, BT_ 등) - pre-commit hook으로 네이밍 컨벤션 자동 검사 추가 - RESTRUCTURE_CHECKLIST.md 작성 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
// Copyright (c) 2024 Synty Studios Limited. All rights reserved.
|
|
//
|
|
// Use of this software is subject to the terms and conditions of the End User Licence Agreement (EULA)
|
|
// of the store at which you purchased this asset.
|
|
//
|
|
// Synty assets are available at:
|
|
// https://www.syntystore.com
|
|
// https://assetstore.unity.com/publishers/5217
|
|
// https://www.fab.com/sellers/Synty%20Studios
|
|
//
|
|
// Sample scripts are included only as examples and are not intended as production-ready.
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Synty.Interface.FantasyWarriorHUD.Samples
|
|
{
|
|
/// <summary>
|
|
/// Oscillates the value of a list of sliders.
|
|
/// </summary>
|
|
public class SampleOscillateSliders : MonoBehaviour
|
|
{
|
|
[Header("References")]
|
|
public List<Slider> sliders;
|
|
|
|
[Header("Parameters")]
|
|
public bool autoGetSliders = true;
|
|
public float speed = 1f;
|
|
public float offset = 0.5f;
|
|
|
|
private void GetSliders()
|
|
{
|
|
#if UNITY_2022_1_OR_NEWER
|
|
sliders = FindObjectsByType<Slider>(FindObjectsInactive.Exclude, FindObjectsSortMode.None).ToList();
|
|
#else
|
|
sliders = FindObjectsOfType<Slider>().ToList();
|
|
#endif
|
|
}
|
|
|
|
private void Reset()
|
|
{
|
|
GetSliders();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
if (autoGetSliders)
|
|
{
|
|
GetSliders();
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
for (int i = 0; i < sliders.Count; i++)
|
|
{
|
|
sliders[i].value = (Mathf.Sin((Time.time * speed) + (i * offset)) * 0.5f) + 0.5f;
|
|
}
|
|
}
|
|
}
|
|
}
|