Ejemplo n.º 1
0
        private async Task <GameObject> GetSaberModel(Saber saber)
        {
            //return saber.GetComponentInChildren<SaberModelController>()?.gameObject;
            SaberModelController smc = null;

            var timeout  = 2000;
            var interval = 300;
            var time     = 0;

            while (!smc)
            {
                smc = saber.GetComponentInChildren <SaberModelController>();

                if (smc)
                {
                    return(smc.gameObject);
                }

                if (time > timeout)
                {
                    return(null);
                }

                time += interval;
                await Task.Delay(interval);
            }

            return(null);
        }
Ejemplo n.º 2
0
        void SetDefaultTrailLength(Saber saber)
        {
            var trail  = saber.GetComponentInChildren <XWeaponTrail>();
            int length = (int)(Configuration.TrailLength * 30);

            if (length < 2)
            {
                HideVanillaTrails();
                return;
            }
            ReflectionUtil.SetField(trail, "_maxFrame", length);
        }
Ejemplo n.º 3
0
        void SetDefaultTrailLength(Saber saber)
        {
            var trail  = saber.GetComponentInChildren <SaberTrail>();
            int length = (int)(Configuration.TrailLength * 30);

            if (length < 2)
            {
                HideVanillaTrails();
                return;
            }
            trail.SetField("_trailDuration", length / 75f);
        }