12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using DG.Tweening;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- //using VacuumShaders.CurvedWorld;
- public class GameController : MonoBehaviour
- {
- [Serializable]
- private class PathSequence
- {
- public Vector3 state;
- public float time;
- }
- [SerializeField]
- private float _maxHeightDiff;
- [SerializeField]
- private float _maxWidthDiff;
- [SerializeField]
- private float _rangeBetweenSwitch;
- [SerializeField]
- private LevelPart _levelPart;
- [SerializeField]
- private int _parts;
- private float _moved;
- [SerializeField]
- private List<PathSequence> _pathSequences;
- private int _index;
- public bool IsPlay;
- internal bool isPause;
- internal bool isPlay;
- public LevelPart last { get; private set; }
- internal void ReportMove(float magnitude)
- {
- _moved += magnitude;
- if (_moved > _rangeBetweenSwitch)
- {
- _moved = 0;
- // DOTween.To(() => _curvedWorld.upDownSize, x=> _curvedWorld.upDownSize = x, _pathSequences[_index].vertical, 3 );
- // DOTween.To(() => _curvedWorld.leftRightSize, x=> _curvedWorld.leftRightSize = x, _pathSequences[_index].horizontal, 3 );
- //DOTween.To(() => _curvedWorld.bendSize.x, x => _curvedWorld.SetBendSizeX(x), _pathSequences[_index].state.x, _pathSequences[_index].time);
- //DOTween.To(() => _curvedWorld.bendSize.y, y => _curvedWorld.SetBendSizeY(y), _pathSequences[_index].state.y, _pathSequences[_index].time);
- //DOTween.To(() => _curvedWorld.bendSize.z, z => _curvedWorld.SetBendSizeZ(z), _pathSequences[_index].state.z, _pathSequences[_index].time);
- _index++;
- if (_index >= _pathSequences.Count)
- {
- _index = 0;
- }
- }
- }
- [SerializeField]
- //private CurvedWorld_Controller _curvedWorld;
- public static GameController instance { get; private set; }
- private void Awake()
- {
- instance = this;
- //_levelPart.gameObject.SetActive(false);
- //for (int i = 0; i < _parts; i++)
- //{
- // var el = Instantiate(_levelPart);
- // if (i == _parts - 1)
- // {
- // last = el;
- // last.SetIndex(i, true);
- // }
- // else
- // {
- // el.SetIndex(i, false);
- // }
- //}
- }
- }
|