123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
-
- // =================================
- // Namespaces.
- // =================================
- using UnityEngine;
- using UnityEngine.UI;
- //using System.Collections;
- // =================================
- // Define namespace.
- // =================================
- namespace MirzaBeig
- {
- namespace ParticleSystems
- {
- namespace Demos
- {
- // =================================
- // Classes.
- // =================================
- //[ExecuteInEditMode]
- [System.Serializable]
- public class DemoManager_XPTitles : MonoBehaviour
- {
- // =================================
- // Nested classes and structures.
- // =================================
- // ...
- // =================================
- // Variables.
- // =================================
- // ...
- LoopingParticleSystemsManager list;
- public Text particleCountText;
- public Text currentParticleSystemText;
- Rotator cameraRotator;
- // =================================
- // Functions.
- // =================================
- // ...
- void Awake()
- {
- (list = GetComponent<LoopingParticleSystemsManager>()).Init();
- }
- // ...
- void Start()
- {
- cameraRotator = Camera.main.GetComponentInParent<Rotator>();
- updateCurrentParticleSystemNameText();
- }
- // ...
- public void ToggleRotation()
- {
- cameraRotator.enabled = (!cameraRotator.enabled);
- }
- public void ResetRotation()
- {
- cameraRotator.transform.eulerAngles = Vector3.zero;
- }
- // ...
- void Update()
- {
- // Scroll through systems.
- if (Input.GetAxis("Mouse ScrollWheel") < 0)
- {
- Next();
- }
- else if (Input.GetAxis("Mouse ScrollWheel") > 0)
- {
- previous();
- }
- //// Activate/deactive camera rotation.
- //if (Input.GetKeyDown(KeyCode.Space))
- //{
- // ToggleRotation();
- //}
- //// Reset camera rotator transform rotation.
- //if (Input.GetKeyDown(KeyCode.R))
- //{
- // ResetRotation();
- //}
- }
- // ...
- void LateUpdate()
- {
- if (particleCountText)
- {
- // Update particle count display.
- particleCountText.text = "PARTICLE COUNT: ";
- particleCountText.text += list.GetParticleCount().ToString();
- }
- }
- // ...
- public void Next()
- {
- list.Next();
- updateCurrentParticleSystemNameText();
- }
- public void previous()
- {
- list.Previous();
- updateCurrentParticleSystemNameText();
- }
- // ...
- void updateCurrentParticleSystemNameText()
- {
- if (currentParticleSystemText)
- {
- currentParticleSystemText.text = list.GetCurrentPrefabName(true);
- }
- }
- // =================================
- // End functions.
- // =================================
- }
- // =================================
- // End namespace.
- // =================================
- }
- }
- }
- // =================================
- // --END-- //
- // =================================
|