public SpaceShipActionsReplay stopRecordingAndGetReplay()
    {
        SpaceShipActionsReplay theResult = _currentRecordingReplay;

        _currentRecordingReplay = null;
        return(theResult);
    }
예제 #2
0
    public System.Collections.IEnumerator startSpawnClones()
    {
        List <SpaceShipActionsReplay> theCurrentIteratorClones = new List <SpaceShipActionsReplay>(_replayForClones);

        int theCurrentSpawnIndex = 0;

        while (theCurrentSpawnIndex < theCurrentIteratorClones.Count)
        {
            SpaceShipActionsReplay theReplay = theCurrentIteratorClones[theCurrentSpawnIndex];

            if (null != theReplay)
            {
                var theCloneController = Instantiate(_clonePrefab);
                iterationController.activeClonesOnScene.Add(theCloneController.gameObject);
                theCloneController.transform.position = spawnController.positionSpawnClone;
                theCloneController.startReplayPlaying(theReplay);

                //performFirstSpawnedCloneTest(theCloneController, theCurrentSpawnIndex);
            }

            ++theCurrentSpawnIndex;

            yield return(new WaitForSeconds(_timeBetweenClonesSpawn));
        }
    }
예제 #3
0
    private SpaceShipActionsReplay destroyPlayerSavingReplay()
    {
        SpaceShipActionsReplay theReplay = _playerSpaceShip.stopRecordingAndGetReplay();

        Destroy(_playerSpaceShip.gameObject);
        return(theReplay);
    }
예제 #4
0
    public void processPlayerSpaceShipDeath(SpaceShipMovement inDeadSpaceShipMovement)
    {
        SpaceShipActionsReplay theReplayOfDeadPlayer = inDeadSpaceShipMovement.GetComponent <SpaceShipPlayerController>().stopRecordingAndGetReplay();

        _replayForClones.Add(theReplayOfDeadPlayer);

        _gameplayManager.EndIteration(false);
        // inDeadSpaceShipMovement.gameObject.SetActive(false);
    }
예제 #5
0
 private void spawnCloneThatPlaysReplay(SpaceShipActionsReplay inReplay)
 {
     if (null == inReplay)
     {
         var theCloneSpaceShip = Instantiate(_cloneSpaceShipPrefab);
         theCloneSpaceShip.transform.position = _startingPlayerSpaceShipPosition;
         theCloneSpaceShip.startReplayPlaying(inReplay);
     }
 }
 public void startReplayPlaying(SpaceShipActionsReplay inReplay) {
     _playingStartTime = Time.fixedTime;
     _replay = inReplay;
     _replayEnumerator = inReplay.getEnumerator();
 }
 public void startNewRecording()
 {
     _currentRecordingReplay = new SpaceShipActionsReplay();
     _recordingStartTime     = Time.fixedTime;
 }
예제 #8
0
    private void performTest()
    {
        SpaceShipActionsReplay theReplay = destroyPlayerSavingReplay();

        spawnCloneThatPlaysReplay(theReplay);
    }