示例#1
0
 public void StartNewGeneration(List <RoomGA> pop, System.Action generationDone)
 {
     _bestTracker.TestNewBest(pop.OrderByDescending(c => c.Fitness).First());
     _bestFitnessCh.RaiseEvent(_bestTracker.FitnessSet.First().fitness);
     _matingPool = GenerateMatingPool(pop);
     GenerateOffspring(pop);
     generationDone();
 }
示例#2
0
    public override void TakeDamage(int damage, Transform damagerTrans)
    {
        base.TakeDamage(damage, damagerTrans);

        OnHitted.RaiseEvent((float)Data.HP / Data.MaxHP);

        this.transform.LookAt(damagerTrans);
        transform.eulerAngles = new Vector3(0, damagerTrans.eulerAngles.y, 0);
    }
示例#3
0
    /// <summary>
    /// Set current settings
    /// </summary>
    void SetCurrentSettings()
    {
        _changeMusicVolumeEventChannel.RaiseEvent(_currentSettings.MusicVolume);   //raise event for volume change
        _changeSFXVolumeEventChannel.RaiseEvent(_currentSettings.SfxVolume);       //raise event for volume change
        _changeMasterVolumeEventChannel.RaiseEvent(_currentSettings.MasterVolume); //raise event for volume change
        Resolution currentResolution = Screen.currentResolution;                   // get a default resolution in case saved resolution doesn't exist in the resolution List

        if (_currentSettings.ResolutionsIndex < Screen.resolutions.Length)
        {
            currentResolution = Screen.resolutions[_currentSettings.ResolutionsIndex];
        }
        Screen.SetResolution(currentResolution.width, currentResolution.height, _currentSettings.IsFullscreen);
        _urpAsset.shadowDistance  = _currentSettings.ShadowDistance;
        _urpAsset.msaaSampleCount = _currentSettings.AntiAliasingIndex;

        LocalizationSettings.SelectedLocale = _currentSettings.CurrentLocale;
    }
 private void SetMasterVolume()
 {
     _masterVolumeEventChannel.RaiseEvent(_masterVolume);         //raise event for volume change
 }
 private void SetSfxVolume()
 {
     _sFXVolumeEventChannel.RaiseEvent(_sfxVolume);         //raise event for volume change
 }
 private void SetMusicVolume()
 {
     _musicVolumeEventChannel.RaiseEvent(_musicVolume);        //raise event for volume change
 }