Exemplo n.º 1
0
    float timer;                                // Timer for counting up to the next attack.


    void Awake()
    {
        // Setting up the references.
        player        = GameObject.FindGameObjectWithTag("Player");
        player1Health = player.GetComponent <HealthBarP1>();
        enemyHealth   = GetComponent <HealthEnnemy>();
        anim          = GetComponent <Animator>();
    }
    // 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;
    }
Exemplo n.º 3
0
    // Use this for initialization

    void Awake()
    {
        player1       = GameObject.FindGameObjectWithTag("player1");
        player1Health = GetComponent <HealthBarP1>();
        rigid         = GetComponent <Rigidbody2D>();
    }