public void bulk_pose_bundle_loaded_callback(AssetBundle aBundle)
    {
        var bf     = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
        var stream = new System.IO.MemoryStream((aBundle.LoadAsset("POSEDICT") as TextAsset).bytes);
        var dict   = bf.Deserialize(stream) as Dictionary <string, string>;

        //Debug.Log("bulk poses");

        foreach (CharacterIndex e in CharacterIndex.sAllCharacters)
        {
            if (e == CharacterIndex.sGrave)
            {
                continue;
            }
            string txtName = "info_" + e.StringIdentifier;
            if (dict.ContainsKey(txtName))
            {
                //Debug.Log ("loaded character info " + txtName);
                mCharacterHelper.Characters[e].CharacterInfo =
                    NUPD.CharacterInformationProcessor.process_character(dict[txtName]);

                //kind of a hack.
                //TODO uncomment this when you get new character packages in...
                GameConstants.INDEX_TO_SHORT_NAME[e] = mCharacterHelper.Characters[e].CharacterInfo.ShortName;
                //GameConstants.INDEX_TO_FULL_NAME[e] = mCharacterHelper.Characters[e].CharacterInfo.LongName;
                GameConstants.INDEX_TO_DESCRIPTION[e] = mCharacterHelper.Characters[e].CharacterInfo.Description;
            }
            else
            {
                throw new UnityException("No info found for " + txtName);
                //Debug.Log ("no info found for " + txtName);
                //mCharacterHelper.Characters[e].CharacterInfo = NUPD.CharacterInformation.default_character_info(e);
            }
        }

        //TODO CAN DELETE
        //this is now called inside of ModeNormalPlay.reset_stats_and_difficulties
        //fetus_difficulty_shuffle_hack();

        foreach (CharacterIndex e in CharacterIndex.sAllCharacters)
        {
            //Debug.Log ("loaded pose for " + e.StringIdentifier);
            for (int i = 0; i < 4; i++)
            {
                for (int j = 1; j < 10; j++) //assuming no mroe than 10 poses per animatino
                {
                    string s = construct_pose_string(e, i, j);
                    if (dict.ContainsKey(s))
                    {
                        //Debug.Log("loaded " + s);
                        mPoses[s] = ProGrading.read_pose(dict[s]);
                    }
                }
            }
        }
        aBundle.Unload(true); //don't need this anymore I don't ithnk...
        mPosesLoaded = true;

        //Debug.Log("end bulk poses");
    }
Exemplo n.º 2
0
 //
 public void load_possible_choice_poses()
 {
     mPossibleChoicePoses = new Pose[ManagerManager.Manager.mReferences.mPossiblePoses.Length];
     for (int i = 0; i < mPossibleChoicePoses.Length; i++)
     {
         mPossibleChoicePoses[i] = ProGrading.read_pose(ManagerManager.Manager.mReferences.mPossiblePoses[i]);
     }
 }
Exemplo n.º 3
0
 //textasset
 public static Pose to_pose(this TextAsset aAsset)
 {
     return(ProGrading.read_pose(aAsset));
 }