123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using System;
- public class FlyPreloaderController : MonoBehaviour
- {
- [SerializeField]
- private Text departurePoint;
- [SerializeField]
- private Text destinationPoint;
- [SerializeField]
- private Image loadImage;
- [SerializeField]
- private float rotationSpeed;
- private void OnEnable()
- {
- if (departurePoint == null || destinationPoint == null)
- {
- gameObject.SetActive(false);
- throw new NullReferenceException("Departure or Destination text reference missing!");
- }
- }
- private void Update()
- {
- if (gameObject.activeInHierarchy)
- loadImage.transform.Rotate(Vector3.back, rotationSpeed);
- }
- public string DeparturePoint
- {
- get
- {
- return departurePoint.text;
- }
- set
- {
- departurePoint.text = value;
- }
- }
- public string DestinationPoint
- {
- get
- {
- return destinationPoint.text;
- }
- set
- {
- destinationPoint.text = value;
- }
- }
- }
|