Esempio n. 1
0
            void CreateEditorChute(ParachuteConfig config, ImmutableTransform transform)
            {
                if (_editorParachute != null)
                {
                    _editorParachute.DetachPilot();
                    GameObject.Destroy(_editorParachute.Root.gameObject);
                }

                _editorParachute = _data.EditorSpawner.Create(config, transform, "EditorParachute");

                _environment.Pilot.SetKinematic();
                _environment.Pilot.OnDespawn();
                _environment.Pilot.transform.position = transform.Position;
                _environment.Pilot.transform.rotation = transform.Rotation;
                _environment.Pilot.OnSpawn();
                _environment.Pilot.SetKinematic();

                _editorParachute.AttachToPilot(_environment.Pilot, Parachute.DefaultUnfoldOrientation, _data.GameSettingsProvider);
                UnityParachuteFactory.SetKinematic(_editorParachute);
                _data.EditorCamera.SetTarget(_editorParachute);

                _editorParachuteChanges.OnNext(_editorParachute);
            }
Esempio n. 2
0
 private void TransitToEditingState()
 {
     _parachute.DetachPilot();
     _parachute.Destroy(0f.Seconds());
     Machine.Transition(Playing.PlayingStates.EditingParachute, _environment);
 }