Esempio n. 1
0
 protected virtual void Awake()
 {
     src        = GetComponent <AudioSource>();
     baseVolume = src.volume;
     VolScale   = new ReflWrap <FXY>(VolumeScaler);
     speedScale = new ReflWrap <FXY>(SpeedScaler);
 }
Esempio n. 2
0
        public static void LocalReset()
        {
            //AudioTrackService.ClearAllAudio();
            SFXService.ClearConstructed();
            Events.Event0.DestroyAll();
            ETime.Slowdown.RevokeAll(MultiOp.Priority.CLEAR_SCENE);
            ETime.Timer.DestroyAll();
            BehaviorEntity.DestroyAllSummons();
            PublicDataHoisting.DestroyAll();
            FiringCtx.ClearNames();
            ReflWrap.ClearWrappers();
            StateMachineManager.ClearCachedSMs();
            BulletManager.ClearPoolControls();
            BulletManager.ClearEmpty();
            BulletManager.ClearAllBullets();
            BulletManager.DestroyCopiedPools();
            InstanceData.CampaignDataUpdated.Proc();
#if UNITY_EDITOR || ALLOW_RELOAD
            Events.LocalReset.Proc();
#endif
            //Ordered last so cancellations from HardCancel will occur under old data
            Instance = new InstanceData(InstanceMode.NULL);
            Debug.Log($"Reloading level: {Difficulty.Describe()} is the current difficulty");
            UIManager.UpdateTags();
        }
Esempio n. 3
0
 protected override void Awake()
 {
     for (int ii = 0; ii < variants.Length; ++ii)
     {
         ReflWrap <TP4> .Load(variants[ii].color);
     }
     base.Awake();
 }
Esempio n. 4
0
        private void Awake()
        {
            tr         = transform;
            burstScale = ReflWrap <FXY> .Wrap(burstScaler);

            var em = particlePrefab.GetComponent <ParticleSystem>().emission;

            baseBurst = em.GetBurst(0);
        }
Esempio n. 5
0
 public static void ClearForScene()
 {
     AudioTrackService.ClearAllAudio(false);
     SFXService.ClearConstructed();
     BulletManager.ClearPoolControls();
     Events.Event0.DestroyAll();
     ETime.Slowdown.RevokeAll(MultiOp.Priority.CLEAR_SCENE);
     ETime.Timer.DestroyAll();
     BulletManager.OrphanAll();
     PublicDataHoisting.DestroyAll();
     FiringCtx.ClearNames();
     //SMs may have links to data hoisting, so we destroy both of them on phase end.
     ReflWrap.ClearWrappers();
     StateMachineManager.ClearCachedSMs();
     BehaviorEntity.ClearPointers();
     AyaPhoto.ClearTextures();
 }
Esempio n. 6
0
        public void Initialize(PlayerInput playr)
        {
            Player = playr;
            //I feel kind of bad about this, but it ensures that PlayerInput is linked before the SM runs.
            base.Awake();
            sr             = GetComponent <SpriteRenderer>();
            original_angle = 0; //Shoot up by default
            freeOffset     = ReflWrap <TP3> .Wrap(offsetFree);

            if (string.IsNullOrWhiteSpace(offsetFocus))
            {
                offsetFocus = offsetFree;
            }
            focusOffset = ReflWrap <TP3> .Wrap(offsetFocus);

            // ReSharper disable once AssignmentInConditionalExpression
            if ((doOpacity = !string.IsNullOrWhiteSpace(opacityFree)))
            {
                freeOpacity = ReflWrap <BPY> .Wrap(opacityFree);

                if (string.IsNullOrWhiteSpace(opacityFocus))
                {
                    opacityFocus = opacityFree;
                }
                focusOpacity = ReflWrap <BPY> .Wrap(opacityFocus);

                rootColor = sr.color;
            }
            freeOffsetPower  = powerOffsetFree.Select(ReflWrap <TP3> .Wrap).ToArray();
            focusOffsetPower = powerOffsetFocus.Select(ReflWrap <TP3> .Wrap).ToArray();
            if (!string.IsNullOrWhiteSpace(spriteRotation))
            {
                rotator = ReflWrap <BPY> .Wrap(spriteRotation);
            }
            if (!string.IsNullOrWhiteSpace(freeAngleOffset))
            {
                freeAngle = ReflWrap <BPY> .Wrap(freeAngleOffset);
            }
            if (!string.IsNullOrWhiteSpace(focusAngleOffset))
            {
                focusAngle = ReflWrap <BPY> .Wrap(focusAngleOffset);
            }
            lastPower = currPower = Math.Min(freeOffsetPower.Length - 1, GameManagement.Instance.PowerIndex);
            SetLocation();
        }
Esempio n. 7
0
 private void Awake()
 {
     foreach (var r in replays)
     {
         r.Frames();
     }
     foreach (var sm in stateMachines)
     {
         StateMachineManager.FromText(sm);
     }
     foreach (var s in reflectFXY)
     {
         ReflWrap <FXY> .Wrap(s);
     }
     foreach (var s in reflectTP3)
     {
         ReflWrap <TP3> .Wrap(s);
     }
 }
Esempio n. 8
0
        public void Preload()
        {
            ReflWrap <TP3> .Load(offsetFree);

            ReflWrap <TP3> .Load(offsetFocus);

            ReflWrap <BPY> .Load(opacityFree);

            ReflWrap <BPY> .Load(opacityFocus);

            powerOffsetFree.ForEach(ReflWrap <TP3> .Load);
            powerOffsetFocus.ForEach(ReflWrap <TP3> .Load);
            ReflWrap <BPY> .Load(spriteRotation);

            ReflWrap <BPY> .Load(freeAngleOffset);

            ReflWrap <BPY> .Load(focusAngleOffset);

            StateMachineManager.FromText(behaviorScript);
        }
Esempio n. 9
0
        private void UpdateVariant()
        {
            var v = variants[currVariant];

            sr.sprite = v.sprite;
            if (effect != null)
            {
                effect.InvokeCull();
            }
            if (time + timePerVariant < StopShiftingAfter)
            {
                effect = Instantiate(switchTell, tr).GetComponent <PowerAura>();
                var opts = new PowerAuraOptions(new[] {
                    PowerAuraOption.Color(ReflWrap <TP4> .Wrap(v.color)),
                    PowerAuraOption.Time(_ => timePerVariant),
                    PowerAuraOption.Iterations(_ => switchTellIterations),
                    PowerAuraOption.Scale(_ => switchTellScale),
                });
                effect.Initialize(new RealizedPowerAuraOptions(opts, GenCtx.Empty, Vector2.zero, Cancellable.Null, null !));
            }
            SFXService.Request(onSwitch);
        }
Esempio n. 10
0
 protected override void Awake()
 {
     base.Awake();
     rotate = ReflWrap <TP3> .Wrap(rotator);
 }