Esempio n. 1
0
 public SoundSettings()
 {
     Mute         = new UIBool("Mute Volume", false);
     MasterVolume = new UIFloat("Master Volume", 0.5f);
     MusicVolume  = new UIFloat("Music Volume", 0.5f);
     SFXVolume    = new UIFloat("Sound Effect Volume", 0.5f);
 }
Esempio n. 2
0
    void Start()
    {
        baseScale    = transform.localScale;
        sunFloatAnim = sun.GetComponent <UIFloat>();

        timer = roundDuration;

        roundHasEnded = false;

        //_playerPlanets = scoreManager.GetComponent<PlayerPlanets>();
    }
    private void Start()
    {
        muzzleLight.enabled = false;
        muzzleObj.SetActive(false);

        if (guardPath.Count < 1)
        {
            Debug.LogWarning($"No Patrol set for guard: {gameObject.name}");
        }

        player = GameObject.FindGameObjectWithTag("Player");

        animator     = GetComponent <Animator>();
        audioSrc     = GetComponent <AudioSource>();
        agent        = GetComponent <NavMeshAgent>();
        lRender      = GetComponent <LineRenderer>();
        levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>();
        bonusUI      = GameObject.Find("Bonus").GetComponent <UIFloat>();
    }
Esempio n. 4
0
        void LoadScreenData(int selScreen)
        {
            var mask = data.Masks [selScreen];

            _uiMasks [0] = new UIFloat(mask.bl.x);
            _uiMasks [1] = new UIFloat(mask.bl.y);
            _uiMasks [2] = new UIFloat(mask.br.x);
            _uiMasks [3] = new UIFloat(mask.br.y);
            _uiMasks [4] = new UIFloat(mask.tl.x);
            _uiMasks [5] = new UIFloat(mask.tl.y);
            _uiMasks [6] = new UIFloat(mask.tr.x);
            _uiMasks [7] = new UIFloat(mask.tr.y);

            _uiUvU = new UIFloat(mask.uvOffset.x);
            _uiUvV = new UIFloat(mask.uvOffset.y);

            var occlusion = data.Occlusions[selScreen];

            _guiOcclusion.Invalidate();
            _guiOcclusion.InitOnce("Occlusion", occlusion.inside);
        }
Esempio n. 5
0
        void UpdateGUI()
        {
            if (_uiN == null)
            {
                _guiWindowPos = new Rect(0.5f * (Screen.width - WINDOW_SIZE.x), 0.5f * (Screen.height - WINDOW_SIZE.y), WINDOW_SIZE.x, WINDOW_SIZE.y);

                _uiN          = new UIInt(_nCols);
                _uiM          = new UIInt(_nRows);
                _uiHBlendings = new UIFloat[0];
                _uiVBlendings = new UIFloat[0];
                _uiGamma      = new UIFloat(data.Gamma);
                _uiMasks      = new UIFloat[8];
                LoadScreenData(SelectedScreen());
                _guiRects = new GUIVector[_rects.Length];
                for (var i = 0; i < _guiRects.Length; i++)
                {
                    _guiRects[i].InitOnce(string.Format("{0}", i), _rects[i]);
                }
            }

            _uiN.Value = Mathf.Clamp(_uiN.Value, 1, 10);
            _uiM.Value = Mathf.Clamp(_uiM.Value, 1, 10);
            if (_uiN.Value != _nCols || _uiM.Value != _nRows)
            {
                _uiN.Value = _nCols = _uiN.Value;
                _uiM.Value = _nRows = _uiM.Value;
                data.Reset(_uiN.Value, _uiM.Value);
            }

            if (_uiHBlendings.Length != (_nCols - 1))
            {
                _uiHBlendings = new UIFloat[_nCols - 1];
                for (var i = 0; i < _uiHBlendings.Length; i++)
                {
                    _uiHBlendings [i] = new UIFloat(data.ColOverlaps [i]);
                }
            }
            if (_uiVBlendings.Length != (_nRows - 1))
            {
                _uiVBlendings = new UIFloat[_nRows - 1];
                for (var i = 0; i < _uiVBlendings.Length; i++)
                {
                    _uiVBlendings [i] = new UIFloat(data.RowOverlaps [i]);
                }
            }
            for (var i = 0; i < _uiHBlendings.Length; i++)
            {
                data.ColOverlaps [i] = _uiHBlendings [i].Value;
            }
            for (var i = 0; i < _uiVBlendings.Length; i++)
            {
                data.RowOverlaps [i] = _uiVBlendings [i].Value;
            }

            data.Gamma = _uiGamma.Value;

            SaveScreenData(SelectedScreen());

            var nScreens = _nCols * _nRows;

            if (_maskSelections == null || _maskSelections.Length != nScreens)
            {
                _maskSelections = new string[nScreens];
                var i = 0;
                for (var y = _nRows - 1; y >= 0; y--)
                {
                    for (var x = 0; x < _nCols; x++)
                    {
                        _maskSelections[i++] = string.Format("{0},{1}", x, y);
                    }
                }
            }

            for (var i = 0; i < _rects.Length; i++)
            {
                var rect = _rects[i];
                for (var j = 0; j < 4; j++)
                {
                    data.Rects[4 * i + j] = rect[j];
                }
            }
        }
Esempio n. 6
0
 public void Initialize(UIFloat setting)
 {
     _setting       = setting;
     _textMesh.text = _setting.Text;
     _slider.value  = _setting.Amount;
 }