Ejemplo n.º 1
0
    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;
    }
Ejemplo n.º 3
0
    // 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;
    }
Ejemplo n.º 4
0
    // 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);
    }