Ejemplo n.º 1
0
        public override void Init(Transform parent, Saber saber)
        {
            if (saber.saberType == SaberType.SaberA)
            {
                _saber = UnityEngine.Object.Instantiate(Plugin.LeftSaber, parent, false);
            }
            else
            {
                _saber = UnityEngine.Object.Instantiate(Plugin.RightSaber, parent, false);
            }

            _saber.transform.localScale = new Vector3(1, 1, Preferences.Length / 0.30f);

            SetColor(_color ?? _colorManager.ColorForSaberType(saber.saberType));

            this.trail = _saber.AddComponent <ClawTrail>();
            this.trail.RegisterPrefab(this._saberTrail.GetPrivateField <SaberTrailRenderer>("_trailRendererPrefab"));
            this.trail.Setup(_color ?? _colorManager.ColorForSaberType(saber.saberType), saber.movementData);
            Plugin.Log.Log(IPA.Logging.Logger.Level.Debug, "_saberTrail has been activated");
        }
Ejemplo n.º 2
0
        public override void Init(Transform parent, Saber saber)
        {
            _saber = Instantiate(
                saber.saberType == SaberType.SaberA
                    ? Plugin.LeftSaber
                    : Plugin.RightSaber,
                parent, false);

            gameObject.transform.SetParent(parent);

            _saber.transform.localScale = new Vector3(1, 1, Preferences.Length / 0.30f);

            Color = _colorManager.ColorForSaberType(saber.saberType);
            SetColor();

            _trail = _saber.AddComponent <ClawTrail>();
            _trail.RegisterPrefab(_saberTrail.GetPrivateField <SaberTrailRenderer>("_trailRendererPrefab"));
            _trail.Setup((Color * _initData.trailTintColor).linear, saber.movementData);
            Plugin.Log.Log(Logger.Level.Debug, "_saberTrail has been activated");
        }