private SaberInstance(
            SaberModel model,
            BasePieceInstance.Factory pieceFactory,
            SiraLog logger,
            TrailConfig trailConfig,
            List <ISaberPostProcessor> saberMiddlewares)
        {
            _logger      = logger;
            _trailConfig = trailConfig;

            Model = model;

            GameObject = new GameObject(SaberName);
            GameObject.AddComponent <SaberMonoBehaviour>().Init(this, _saberComponents, OnSaberGameObjectDestroyed);

            CachedTransform = GameObject.transform;

            PieceCollection = new PieceCollection <BasePieceInstance>();

            var sectionInstantiator = new SectionInstantiator(this, pieceFactory, PieceCollection);

            sectionInstantiator.InstantiateSections();

            GameObject.transform.localScale = new Vector3(model.SaberWidth, model.SaberWidth, model.SaberLength);

            saberMiddlewares.Do(x => x.ProcessSaber(GameObject));

            SetupTrailData();
            InitializeEvents();
        }
        private SaberInstance(SaberModel model, BasePieceInstance.Factory pieceFactory, SiraLog logger)
        {
            _logger = logger;

            Model           = model;
            GameObject      = new GameObject("SF Saber");
            CachedTransform = GameObject.transform;

            PieceCollection = new PieceCollection <BasePieceInstance>();

            _sectionInstantiator = new SectionInstantiator(this, pieceFactory, PieceCollection);
            _sectionInstantiator.InstantiateSections();

            GameObject.transform.localScale = new Vector3(model.SaberWidth, model.SaberWidth, 1);

            _colorMaterials = new List <Material>();
            GetColorableMaterials(_colorMaterials);

            SetupTrailData();
            InitializeEvents();
        }
Exemple #3
0
        private SaberInstance(SaberModel model, BasePieceInstance.Factory pieceFactory, SiraLog logger, TrailConfig trailConfig)
        {
            _logger      = logger;
            _trailConfig = trailConfig;

            Model           = model;
            GameObject      = new GameObject("SF Saber");
            CachedTransform = GameObject.transform;

            PieceCollection = new PieceCollection <BasePieceInstance>();

            var sectionInstantiator = new SectionInstantiator(this, pieceFactory, PieceCollection);

            sectionInstantiator.InstantiateSections();

            GameObject.transform.localScale = new Vector3(model.SaberWidth, model.SaberWidth, 1);

            GameObject.SetLayer <Renderer>(12);

            SetupTrailData();
            InitializeEvents();
        }