Esempio n. 1
0
 public void Start()
 {
     _riggerStory = gameObject.AddComponent <CharacterStory>();
     _riggerStory.InitWithKey(CharacterKey.Rigger);
     _architectStory = gameObject.AddComponent <CharacterStory>();
     _architectStory.InitWithKey(CharacterKey.Architect);
 }
Esempio n. 2
0
        protected virtual void ValidateCharacterStory(CharacterStory story)
        {
            if (story != null && story.fightsGroups != null)
            {
                foreach (FightsGroup group in story.fightsGroups)
                {
                    List <StoryModeBattle> battles = new List <StoryModeBattle>(group.opponents);

                    for (int i = battles.Count - 1; i >= 0; --i)
                    {
                        StoryModeBattle battle = battles[i];

                        if (battle.opponentCharacterIndex < 0 || battle.opponentCharacterIndex >= this.characters.Length)
                        {
                            battles.RemoveAt(i);
                        }
                        else
                        {
                            for (int j = battle.possibleStagesIndexes.Count - 1; j >= 0; --j)
                            {
                                int stageIndex = battle.possibleStagesIndexes[j];

                                if (stageIndex < 0 || stageIndex >= this.stages.Length)
                                {
                                    battle.possibleStagesIndexes.RemoveAt(j);
                                }
                            }

                            if (battle.possibleStagesIndexes.Count == 0 && this.stages.Length > 0)
                            {
                                battle.possibleStagesIndexes.Add(i % this.stages.Length);
                            }
                        }
                    }

                    group.opponents = battles.ToArray();
                }
            }
        }
Esempio n. 3
0
    protected virtual void ValidateCharacterStory(CharacterStory story)
    {
        if (story != null && story.fightsGroups != null){
            foreach(FightsGroup group in story.fightsGroups){
                List<StoryModeBattle> battles = new List<StoryModeBattle>(group.opponents);

                for (int i = battles.Count - 1; i >= 0; --i){
                    StoryModeBattle battle = battles[i];

                    if (battle.opponentCharacterIndex < 0 || battle.opponentCharacterIndex >= this.characters.Length){
                        battles.RemoveAt(i);
                    }else{
                        for (int j = battle.possibleStagesIndexes.Count - 1; j >= 0; --j){
                            int stageIndex = battle.possibleStagesIndexes[j];

                            if (stageIndex < 0 || stageIndex >= this.stages.Length){
                                battle.possibleStagesIndexes.RemoveAt(j);
                            }
                        }

                        if (battle.possibleStagesIndexes.Count == 0 && this.stages.Length > 0){
                            battle.possibleStagesIndexes.Add(i % this.stages.Length);
                        }
                    }
                }

                group.opponents = battles.ToArray();
            }
        }
    }