Пример #1
0
 private void Close()
 {
     if (_state == OpenCloseCircleState.OPENED)
     {
         _delta = 0f;
         _state = OpenCloseCircleState.CLOSING;
     }
 }
Пример #2
0
 private void UpdateClosing(float t)
 {
     UpdateAng();
     _radius = Mathf.Lerp(
         OpenCloseCircleSettings.Instance.openedRadius,
         OpenCloseCircleSettings.Instance.closedRadius,
         t);
     UpdateBlackRects();
     if (t >= 1f)
     {
         _state = OpenCloseCircleState.CLOSED;
         Invoke(OpenCloseEvent.FINISH_CLOSE);
     }
 }
Пример #3
0
    void Start()
    {
        _state         = OpenCloseCircleState.OPENED;
        _blackRects    = new List <Transform>();
        _radius        = OpenCloseCircleSettings.Instance.openedRadius;
        _alpha         = 2 * Mathf.PI / OpenCloseCircleSettings.Instance.nBlackRects;
        _eventsManager = new EventsManager <OpenCloseEvent>();

        for (int i = 0; i < OpenCloseCircleSettings.Instance.nBlackRects; i++)
        {
            Transform t = OpenCloseCircleFactory.Instance.CreateBlackRect().transform;
            t.SetParent(transform, false);
            t.localPosition    = Vector3.zero;
            t.localEulerAngles = Vector3.forward * _alpha * i * Mathf.Rad2Deg;
            _blackRects.Add(t);
        }

        UpdateBlackRects();
    }