예제 #1
0
    void moveToTarget()
    {
        Debug.Log("MOVING TO " + targetLocation.ModuleType);
        var movingLocation = targetLocation;

        currentLocation.GetComponent <ModuleWorkingPlaces>().ReleaseWorkingPlace(this);
        var wokingPlace = targetLocation.GetComponent <ModuleWorkingPlaces>();
        var targetPlace = wokingPlace.ReserveWorkingPlace(this);

        currentLocation.AstronautExit(this);

        _movingCoroutine = StartCoroutine(MoveToModuleCoroutine(targetPlace, () =>
        {
            currentLocation = movingLocation;
            currentLocation.AstronautEnter(this);
            targetLocation = null;
        }));
    }