diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs')
-rw-r--r-- | Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs b/Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs deleted file mode 100644 index d1c108bb..00000000 --- a/Assets/ThirdParty/MaterializeFX/Scripts/Utils/DemoPrefabController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine;
-
-namespace Assets.MaterializeFX.Scripts.Utils
-{
- internal sealed class DemoPrefabController : MonoBehaviour
- {
- public int StartNum;
- public GameObject[] Prefabs;
-
- private GameObject _currentInstance;
- private int _currentPrefabNum;
-
- public void Next()
- {
- if (Prefabs.Length == 0)
- return;
-
- _currentPrefabNum++;
- if (_currentPrefabNum >= Prefabs.Length)
- _currentPrefabNum = 0;
-
- ChangePrefab(_currentPrefabNum);
- }
-
- private void Start()
- {
- _currentPrefabNum = StartNum;
-
- ChangePrefab(_currentPrefabNum);
- }
-
- private void ChangePrefab(int num)
- {
- if (_currentInstance != null)
- Destroy(_currentInstance);
- var newPrefab = Prefabs[num];
- _currentInstance = Instantiate(newPrefab, newPrefab.transform.position, newPrefab.transform.transform.rotation);
- _currentInstance.SetActive(true);
- }
- }
-}
\ No newline at end of file |