LevelPart.cs 614 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class LevelPart : MonoBehaviour
  5. {
  6. [SerializeField]
  7. private Vector3 _size;
  8. [SerializeField]
  9. private GameObject _tower;
  10. [SerializeField]
  11. private Transform _cameraFinish;
  12. [SerializeField]
  13. private Animator _animator;
  14. public Transform camFinish => _cameraFinish;
  15. public Animator princessAnimator => _animator;
  16. public void SetIndex(int index, bool tower)
  17. {
  18. _tower.SetActive(tower);
  19. transform.position = _size * index;
  20. gameObject.SetActive(true);
  21. }
  22. }