コード例 #1
0
        void Spawn(LocationEntrance spawnPoint)
        {
            PlayerCharacter pc = InstantiatePlayer(spawnPoint.transform);

            _playerCharacterAnchor.SetReference(pc);

            spawnPoint.RunPlayerSpawnSequence(pc, HandleSpawnSequencesFinished);
        }
コード例 #2
0
        public void SpawnPlayer()
        {
            _spawnPoints = FindObjectsOfType <LocationEntrance>();
            LocationEntrance spawnPoint = _defaultSpawnPoint;
            PathSO           pathTaken  = _pathTakenManagerAnchor.GetReference().GetPathTaken();

            if (pathTaken != null)
            {
                foreach (LocationEntrance anEntrance in _spawnPoints)
                {
                    if (anEntrance.EntrancePath == pathTaken)
                    {
                        spawnPoint = anEntrance;
                    }
                }
            }

            Spawn(spawnPoint);
        }
コード例 #3
0
        void Spawn(LocationEntrance spawnPoint)
        {
            PlayerCharacter pc = Instantiate(_playerPrefab, spawnPoint.transform.position, _playerPrefab.transform.rotation);

            spawnPoint.RunPlayerSpawnSequence(pc, HandleSpawnSequenceFinished);
        }