Example #1
0
        public override async void Init(Transform parent, Saber saber)
        {
            await _gameSaberSetup.SetupTask;

            transform.SetParent(parent, false);

            var saberModel = saber.saberType == SaberType.SaberA ? _saberSet.LeftSaber : _saberSet.RightSaber;

            _saberInstance = _saberInstanceFactory.Create(saberModel);
            _saberInstance.SetParent(transform);
            _saberInstance.CreateTrail(_saberTrail);
            SetColor(_saberColor ?? _colorManager.ColorForSaberType(_saberInstance.Model.SaberSlot.ToSaberType()));

            if (_afHandler != null && AFHandler.IsValid && AFHandler.ShouldFire)
            {
                await Task.Delay(4000);

                await _afHandler.Shoot(this, saber.saberType);
            }
            else
            {
                _eventPlayer?.SetPartEventList(_saberInstance.Events, saber.saberType);
            }

            _logger.Info("Instantiated Saber");
        }
Example #2
0
        public override void Init(Transform parent, Saber saber)
        {
            var saberModel = saber.saberType == SaberType.SaberA ? _saberSet.LeftSaber : _saberSet.RightSaber;

            _saberInstance = _saberInstanceFactory.Create(saberModel);

            _saberInstance.SetParent(parent);
            _saberInstance.CreateTrail(_saberTrail.GetField <SaberTrailRenderer, SaberTrail>("_trailRendererPrefab"));
            SetColor(_saberColor ?? _colorManager.ColorForSaberType(_saberInstance.Model.SaberSlot.ToSaberType()));

            _eventPlayer?.SetPartEventList(_saberInstance.Events, saber.saberType);

            _logger.Info("Instantiated Saber");
        }
Example #3
0
 public void GrabSaber(SaberInstance saberInstance)
 {
     HideHandle();
     _currentSaberInstancce = saberInstance;
     saberInstance.SetParent(GrabContainer);
 }