示例#1
0
    private void Start()
    {
        inactiveSkinBoxes = new List <SkinBox>(skinBoxes);
        _currentSkinBox   = null;

        SetupSkinBoxes();
    }
示例#2
0
    void SetCurrentSkinBox(SkinBox skinBox)
    {
        if (_currentSkinBox != null)
        {
            _currentSkinBox.Deselect();
        }

        _currentSkinBox = skinBox;

        _currentSkinBox.Select();
    }
示例#3
0
    public void ChooseSkinbox()
    {
        _elapsedTime += Time.deltaTime;

        var isFinal = _traveledCount == TravelCount || inactiveSkinBoxes.Count == 0;
        var inTime  = _elapsedTime >= _traveledCount / 10f;

        if (!isFinal && inTime)
        {
            // Reset time
            _elapsedTime = 0f;

            ++_traveledCount;
            SelectSkinBox();
        }
        else if (isFinal && inTime)
        {
            _elapsedTime = 0f;
            _currentSkinBox.Activate();
            _currentSkinBox = null;
            _traveledCount  = 0;
            _travel         = false;
        }
    }