Esempio n. 1
0
            public void Start()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.InputBuffer, new Action <int>(ServeBuffer));

                inputFactory = new Input.Factory();
                inputBuffer  = new GameInputStruct[bufferLength];
                currState    = new GameInputStruct {
                    direction = FightingGameAbsInputCodeDir.Neutral,
                    butA      = false,
                    butB      = false,
                    butC      = false,
                    butD      = false,
                    butS      = false,
                };

                for (int n = 0; n < inputBuffer.Length; ++n)
                {
                    inputBuffer[n] = new GameInputStruct {
                        direction = FightingGameAbsInputCodeDir.Neutral,
                        butA      = false,
                        butB      = false,
                        butC      = false,
                        butD      = false,
                        butS      = false,
                    };
                }

                inputCombinations = new List <Input.Combinations.Combination>();
            }
Esempio n. 2
0
            public void Start()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.Service, new System.Action <int>(FrameUpdate));
                playerService      = GetComponent <PlayerService>();
                fgService          = GetComponent <FightingGameService>();
                persistenceService = GetComponent <PersistenceService>();
                uiService          = GetComponent <UiService>();

                EventManager.TriggerEvent <Events.ServiceReady, Type>(typeof(FightingGameService));
            }
Esempio n. 3
0
            public void Awake()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.Gamemode, new Action <int>(FrameUpdate));
                gameTimeManager = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>();

                gameTimeManager.AddLayer(new Func <float, float>(GameTime), "gameTime");

                EventManager.StartListening <Events.FrameEnforcerReady>(new UnityAction(EnablePlayers));
                EventManager.StartListening <Events.StartGame>(new UnityAction(StartGame));
            }
Esempio n. 4
0
            public void Awake()
            {
                inputCallbacks  = new Dictionary <Type, Action <Action, Combination> >();
                enterCallbacks  = new Dictionary <Type, Action <Action, Combination> >();
                inputRegistry   = new CallbackRegistry(inputCallbacks);
                enterRegistry   = new CallbackRegistry(enterCallbacks);
                stopInputSearch = new Action(StopInputSearch);

                states = gameObject.GetComponentInParent <StateDict>();
                fgChar = gameObject.GetComponentInParent <FightingGameCharacter>();
                frame  = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
            }
Esempio n. 5
0
            public void Start()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.Service, new System.Action <int>(FrameUpdate));
                frame.AddUpdate((int)FramePriority.ActivePollingReset, new System.Action <int>(ResetActivePolling));

                hitBoxMap              = new Dictionary <int, HitBox>();
                activeHitBoxes         = new List <HitBox>();
                previousActiveHitBoxes = new List <HitBox>();

                EventManager.TriggerEvent <Events.ServiceReady, Type>(typeof(HitBoxService));
            }
Esempio n. 6
0
            public void Start()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.Service, new System.Action <int>(FrameUpdate));
                frame.AddUpdate((int)FramePriority.ActivePollingReset, new System.Action <int>(ResetActivePolling));

                projectilePrefabs = new Dictionary <int, GameObject>();
                projectileMap     = new Dictionary <int, ResourceRecycler <Projectile> >();

                activeProjectiles = new List <Projectile>();

                EventManager.TriggerEvent <Events.ServiceReady, Type>(typeof(ProjectileService));
            }
Esempio n. 7
0
            public void Awake()
            {
                inputBuffer = GetComponent <InputBuffer>();

                inputActions = new BasicActions();

                inputActions.GamePlay.Move.performed    += OnMove;
                inputActions.GamePlay.ButtonA.performed += OnButtonA;
                inputActions.GamePlay.ButtonB.performed += OnButtonB;
                inputActions.GamePlay.ButtonC.performed += OnButtonC;
                inputActions.GamePlay.ButtonD.performed += OnButtonD;
                inputActions.GamePlay.ButtonS.performed += OnButtonS;

                FrameEnforcer frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();

                frame.AddUpdate((int)FramePriority.InputBuffer, new Action <int>(FrameUpdate));
            }
Esempio n. 8
0
            public void Start()
            {
                frame = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
                frame.AddUpdate((int)FramePriority.Service, new System.Action <int>(FrameUpdate));
                frame.AddUpdate((int)FramePriority.ActivePollingReset, new System.Action <int>(ResetActivePolling));

                audioSources = new ResourceRecycler <AudioResource>(prefab, Vector3.zero, 4, audioEmpty, resource => {
                    Debug.Log("callback called");
                    resource.SetService(this);
                    resource.Deactivate();
                });

                // This works exactly as expected.
                //AudioSource test = GameObject.Instantiate<AudioSource>(prefab, new Vector3(-33, 0, 47), Quaternion.identity);
                //test.Play();

                activeSounds         = new List <AudioResource>();
                previousActiveSounds = new List <AudioResource>();

                activeOneShots = new List <AudioResource>();

                EventManager.TriggerEvent <Events.ServiceReady, Type>(typeof(AudioService));
            }
Esempio n. 9
0
 public void Awake()
 {
     fgChar = gameObject.GetComponentInParent <FightingGameCharacter>();
     frame  = GameObject.FindGameObjectWithTag("rspTime").GetComponent <FrameEnforcer>();
 }
Esempio n. 10
0
 public void StartStateMachine(FrameEnforcer frame)
 {
     stateMachine.Enable(initState, frame);
 }
Esempio n. 11
0
 public void Start()
 {
     frame = gameObject.GetComponent <FrameEnforcer>();
     frame.AddUpdate((int)FramePriority.UpdateInput, new Action <int>(ProcessEventsManually));
 }