Пример #1
0
 private bool CharacterAlreadyChosen(string charName)
 {
     for (int i = 0; i < chosenChars; i++)
     {
         if (charName == CurrentFightStats.GetSelectedCharacter(i, "Player1"))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        characterName = CurrentFightStats.GetSelectedCharacter(transform.GetSiblingIndex(), gameObject.tag);
        //characterName = "Ken";  //For testing
        characterSeries = CharacterSelectionMapping.GetCharacterSeries(characterName);
        var type = Type.GetType(characterName);

        character = (Character)Activator.CreateInstance(type);
        healthBar = new HealthBar(health.transform.GetChild(transform.GetSiblingIndex()).gameObject, character.GetHealth(), characterName);
        animator.runtimeAnimatorController = Resources.Load("Animation/Characters/" + characterSeries + "/" + characterName + "/" + characterName) as RuntimeAnimatorController;
        SetIsAI(CurrentFightStats.GetAI(transform.tag));
        characterVoice = CharacterVoicePlayer.GetComponent <CharacterVoice>();
    }
Пример #3
0
    private void SetVsPortraits(GameObject portraits)
    {
        int portraitNumber = 0;

        foreach (Transform portrait in portraits.transform)
        {
            string charName        = CurrentFightStats.GetSelectedCharacter(portraitNumber, portrait.tag);
            string characterSeries = CharacterSelectionMapping.GetCharacterSeries(charName);
            portrait.GetComponent <SpriteRenderer>().sprite = Resources.Load <Sprite>("Textures_and_Sprites/Menus/Interface/CharacterSelectionMenu/CharacterProfile/"
                                                                                      + characterSeries + "/" + charName + "/" + "Chosen" + charName + "Background");
            portraitNumber++;
        }
    }
Пример #4
0
    IEnumerator FightStart()
    {
        yield return(new WaitUntil(() => announcer.GetComponent <AnnouncerVoice>().AnnouncerIsPlaying() == false));

        yield return(new WaitForSeconds(0.5f));

        announcerText.sprite = Resources.Load <Sprite>("Textures_and_Sprites/Menus/Interface/Fight/Texts/Fight");
        announcer.GetComponent <AnnouncerVoice>().PlayAnnouncer("Fight");
        yield return(new WaitForSeconds(0.2f));

        fightStarted = true;
        player1.transform.GetChild(0).GetComponent <CharacterFeatures>().SetIsBlocked(false);
        player2.transform.GetChild(0).GetComponent <CharacterFeatures>().SetIsBlocked(false);
        announcerText.GetComponent <Image>().color = new Color(announcerText.color.r, announcerText.color.g, announcerText.color.b, 0f);
        music.GetComponent <MusicPlayer>().PlayMusic(CurrentFightStats.GetSelectedCharacter(0, "Player1"));
        music.GetComponent <AudioSource>().loop = true;
    }