基础内容
必要插件安装 缓动曲线和动画基础 ElementFolder,Track与其次级模块,PathNode重构
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using MoreMountains.Tools;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MoreMountains.Feel
|
||||
{
|
||||
[AddComponentMenu("")]
|
||||
public class FeelSpringsDemoManager : MonoBehaviour
|
||||
{
|
||||
[Header("Bindings")]
|
||||
public List<GameObject> DemoObjects;
|
||||
[MMReadOnly] public int CurrentIndex = 0;
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
EnableCurrentDemo();
|
||||
}
|
||||
|
||||
public virtual void NextDemo()
|
||||
{
|
||||
CurrentIndex++;
|
||||
if (CurrentIndex >= DemoObjects.Count)
|
||||
{
|
||||
CurrentIndex = 0;
|
||||
}
|
||||
EnableCurrentDemo();
|
||||
}
|
||||
|
||||
public virtual void PreviousDemo()
|
||||
{
|
||||
CurrentIndex--;
|
||||
if (CurrentIndex < 0)
|
||||
{
|
||||
CurrentIndex = DemoObjects.Count - 1;
|
||||
}
|
||||
EnableCurrentDemo();
|
||||
}
|
||||
|
||||
protected virtual void EnableCurrentDemo()
|
||||
{
|
||||
foreach (GameObject demoObject in DemoObjects)
|
||||
{
|
||||
demoObject.gameObject.SetActive(false);
|
||||
}
|
||||
DemoObjects[CurrentIndex].SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user