コード例 #1
0
        private IEnumerator LocationRoutine(Dicts.Locations nextLocation)
        {
            if (_curtain)
            {
                for (int i = 1; i <= _fadingSteps; i++)
                {
                    var step = nextLocation == Dicts.Locations.None
                        ? (1.0f * _fadingSteps - i)
                        : (1.0f * i);

                    _curtain.color = new Color(_curtain.color.r, _curtain.color.g, _curtain.color.b, step / _fadingSteps);
                    yield return(new WaitForSeconds(_fadingDuration / _fadingSteps));
                }
            }

            if (nextLocation == Dicts.Locations.None)
            {
                Master.LocationEntered();
            }
            else
            {
                Master.LocationExited(nextLocation);
            }
        }
コード例 #2
0
 private void ExitLocation(Dicts.Locations to)
 {
     StartCoroutine(LocationRoutine(to));
 }