示例#1
0
    // Use this for initialization

    void Start()
    {
        animator         = GetComponentInChildren <Animator>();
        character        = GetComponentInChildren <Character>();
        sharedProperties = GetComponent <SharedProperties>();
        if (GetComponentInChildren <FeiLong>() != null)
        {
            feiLong = GetComponentInChildren <FeiLong>();
        }
    }
    // 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;
    }