Example #1
0
        public async Task <SaberInstance> CreateSaber(Transform parent, SaberType saberType, Color color, bool createTrail)
        {
            await _saberSet.WaitForFinish();

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

            var saber = _saberInstanceFactory.Create(saberModel);

            saber.SetParent(parent);
            if (createTrail)
            {
                saber.CreateTrail(true);
            }

            saber.SetColor(color);

            return(saber);
        }