public void Init(CharacterData charData)
            {
                base.Init();
                this.fgCharId = fgCharCounter++;

                this.charData = charData;
                teamId        = 0;

                health = charData.maxHealth;

                fgService = GameObject.FindGameObjectWithTag("rspService").GetComponent <FightingGameService>();

                inputDoNothingList = new List <Combination> {
                    ScriptableObject.CreateInstance <DirectionCurrent>().Init(0, Input.FightingGameAbsInputCodeDir.Neutral)
                };

                rigidbody         = gameObject.GetComponent <Rigidbody>();
                inUseCombinations = new List <Combination>();

                onHealthChangeCallbacks = new List <Action <int, int> >();
                onEmptyHealthCallbacks  = new List <Action <FightingGameCharacter> >();

                attackState = stateMachine.gameObject.GetComponentInChildren <CharacterStates.Attack>();

                gameTimeManager = GameObject.FindGameObjectWithTag("rspTime").GetComponent <GameTimeManager>();
            }
Ejemplo 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));
            }
Ejemplo n.º 3
0
            public void Start()
            {
                fgService         = GetComponent <FightingGameService>();
                audioService      = GetComponent <AudioService>();
                hitBoxService     = GetComponent <HitBoxService>();
                projectileService = GetComponent <ProjectileService>();

                services = new AllServices()
                           .AddServiceAs <IBuildService>(this)
                           .AddServiceAs <IFightingGameService>(fgService)
                           .AddServiceAs <IAudioService>(audioService)
                           .AddServiceAs <IHitBoxService>(hitBoxService)
                           .AddServiceAs <IProjectileService>(projectileService);

                EventManager.TriggerEvent <Events.ServiceReady, Type>(typeof(BuildService));
            }
Ejemplo n.º 4
0
            public void SetUp(PlayerService playerService, FightingGameService fgService, UiService uiService)
            {
                this.playerService = playerService;
                this.fgService     = fgService;
                this.uiService     = uiService;

                char0 = playerService.GetFGChar(0);
                char1 = playerService.GetFGChar(1);

                char0.SetOpponentCharacter(char1);
                char1.SetOpponentCharacter(char0);

                char0.RegisterOnHealthChangeCallback(OnPlayerHealthChange(0));
                char1.RegisterOnHealthChangeCallback(OnPlayerHealthChange(1));

                char0.RegisterOnEmptyHealthCallback(OnPlayerEmptyHealth);
                char1.RegisterOnEmptyHealthCallback(OnPlayerEmptyHealth);
            }