public override void OnStateEnter() { base.OnStateEnter(); timer = 0.0f; chargeSystem = context.transform.GetComponentInChildren <ChargeSystem>(); chargeSystem.BeginCharge(); }
// Use this for initialization void Start() { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); physicsbody = GetComponentInChildren <Rigidbody2D>(); comboSystem = GetComponent <ComboSystem>(); chargeSystem = GetComponent <ChargeSystem>(); character.side = Character.Side.P1; healthBar = FindObjectOfType <HealthBarP1>(); superBar = FindObjectOfType <SuperBarP1>(); if (character.GetComponent <FeiLong>() != null) { feiLong = GetComponentInChildren <FeiLong>(); feiLongAI = GetComponentInChildren <FeiLongAI>(); CharacterInitialize(feiLongMugShot, "Fei Long", feiLongAI.Behaviors); } else if (character.GetComponent <Ken>() != null) { kenAI = GetComponentInChildren <KenAI>(); CharacterInitialize(kenMugShot, "Ken", kenAI.Behaviors); } else if (character.GetComponent <Balrog>() != null) { balrogAI = GetComponentInChildren <BalrogAI>(); CharacterInitialize(balrogMugShot, "Balrog", balrogAI.Behaviors); } else if (character.GetComponent <Akuma>() != null) { akumaAI = GetComponentInChildren <AkumaAI>(); CharacterInitialize(akumaMugShot, "Akuma", akumaAI.Behaviors); } else if (character.GetComponent <Sagat>() != null) { sagatAI = GetComponentInChildren <SagatAI>(); CharacterInitialize(sagatMugShot, "Sagat", sagatAI.Behaviors); } else if (character.GetComponent <MBison>() != null) { mbisonAI = GetComponentInChildren <MBisonAI>(); CharacterInitialize(mbisonMugShot, "M Bison", mbisonAI.Behaviors); } projectileP1Parent = GameObject.Find("ProjectileP1Parent"); if (projectileP1Parent == null) { projectileP1Parent = new GameObject("ProjectileP1Parent"); } comboCounter = FindObjectOfType <ComboCounter>(); introPlayed = false; }
// Use this for initialization void Start() { if (GetComponentInParent <Opponent>() != null) { player = FindObjectOfType <Player>(); playerCharacter = player.GetComponentInChildren <Character>(); } else if (GetComponentInParent <Player>() != null) { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); } character = GetComponent <Character>(); animator = GetComponent <Animator>(); AIcontrols = GetComponentInParent <AIControls>(); chargeSystem = GetComponentInParent <ChargeSystem>(); sharedProperties = GetComponentInParent <SharedProperties>(); regularFarRangeDecisions = new List <string>(); regularMidRangeDecisions = new List <string>(); regularCloseRangeDecisions = new List <string>(); airAttackDecisions = new List <string>(); otherFighterBlockedDecisions = new List <string>(); otherFighterGotHitDecisions = new List <string>(); knockDownDecisions = new List <string>(); antiAirDecisions = new List <string>(); RegularFarRangeDecisionTrees(); RegularMidRangeDecisionTrees(); RegularCloseRangeDecisionTrees(); AirAttackDecisionTrees(); OtherFighterBlockedDecisionTrees(); OtherFighterGotHitDecisionTrees(); KnockDownDecisionTrees(); AntiAirDecisionTrees(); decision = Random.Range(0, DECISION_MAX); decisionTimerInput = decisionTimer; antiAirTimerInput = antiAirTimer; antiAirTimer = 0f; }
// Use this for initialization void Start() { if (GetComponentInParent <Opponent>() != null) { player = FindObjectOfType <Player>(); playerCharacter = player.GetComponentInChildren <Character>(); } else if (GetComponentInParent <Player>() != null) { opponent = FindObjectOfType <Opponent>(); opponentCharacter = opponent.GetComponentInChildren <Character>(); } character = GetComponent <Character>(); animator = GetComponent <Animator>(); AIcontrols = GetComponentInParent <AIControls>(); chargeSystem = GetComponentInParent <ChargeSystem>(); sharedProperties = GetComponentInParent <SharedProperties>(); decisionTimerInput = decisionTimer; antiAirTimerInput = antiAirTimer; antiAirTimer = 0f; decision = Random.Range(0, 100); }