public void OnHitAttack(AttackHitInfo info, AttackHitColliderProcessor.HitParam hit_param)
    {
        List <HitRecord> list = attackHitList.Get(info.name);

        if (list == null)
        {
            list = new List <HitRecord>();
            attackHitList.Add(info.name, list);
        }
        HitRecord hitRecord = null;
        int       i         = 0;

        for (int count = list.Count; i < count; i++)
        {
            if (list[i].target == hit_param.toObject)
            {
                hitRecord = list[i];
                break;
            }
        }
        if (hitRecord == null)
        {
            hitRecord        = new HitRecord();
            hitRecord.target = hit_param.toObject;
            list.Add(hitRecord);
        }
        hitRecord.lastHitTime = Time.get_time();
    }
Пример #2
0
    public void CreateTable(string csv_text, bool encrypted)
    {
        stringKeyTable = new StringKeyTable <UIntKeyTable <string> >();
        CSVReader             cSVReader    = new CSVReader(csv_text, "category,id,strJP", encrypted);
        UIntKeyTable <string> uIntKeyTable = null;

        while (cSVReader.NextLine())
        {
            string value = string.Empty;
            cSVReader.Pop(ref value);
            if (value.Length > 0)
            {
                uIntKeyTable = stringKeyTable.Get(value);
                if (uIntKeyTable == null)
                {
                    uIntKeyTable = new UIntKeyTable <string>();
                    stringKeyTable.Add(value, uIntKeyTable);
                }
            }
            if (uIntKeyTable != null)
            {
                uint   value2 = 0u;
                bool   flag   = cSVReader.Pop(ref value2);
                string value3 = string.Empty;
                bool   flag2  = cSVReader.Pop(ref value3);
                if (flag && value3.Length != 0)
                {
                    uIntKeyTable.Add(value2, value3);
                }
            }
        }
        stringKeyTable.TrimExcess();
    }
    public void MarkSystemPackage(string cahced_package_name)
    {
        PackageObject packageObject = packageCaches.Get(cahced_package_name);

        if (packageObject != null)
        {
            packageCaches.Remove(cahced_package_name);
            systemPackageCaches.Add(cahced_package_name, packageObject);
        }
    }
    public void CreateCommonResourceTable(TextAsset text_asset)
    {
        CSVReader cSVReader = new CSVReader(text_asset.get_text(), "name,useRes", true);

        while (cSVReader.NextLine())
        {
            string value  = string.Empty;
            string value2 = string.Empty;
            cSVReader.Pop(ref value);
            cSVReader.Pop(ref value2);
            if (value.Length > 0 && value2.Length > 0)
            {
                commonResourceTable.Add(value, value2);
            }
        }
    }
Пример #5
0
    public static StringKeyTable <T> CreateStringKeyTable <T>(string text, CallBackStringKeyReadCSV <T> cb, string name_table) where T : new()
    {
        StringKeyTable <T> stringKeyTable = new StringKeyTable <T>();
        CSVReader          cSVReader      = new CSVReader(text, name_table, false);

        while (cSVReader.NextLine())
        {
            string value = string.Empty;
            if ((bool)cSVReader.Pop(ref value) && value.Length > 0)
            {
                T val = new T();
                if (!cb(cSVReader, val, ref value))
                {
                    stringKeyTable.Clear();
                    return(null);
                }
                stringKeyTable.Add(value, val);
            }
        }
        return(stringKeyTable);
    }
    public void CacheShadersFromPackage(string cahced_package_name)
    {
        //IL_002d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0032: Expected O, but got Unknown
        //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00be: Unknown result type (might be due to invalid IL or missing references)
        PackageObject cachedPackage = GetCachedPackage(cahced_package_name);

        if (cachedPackage != null)
        {
            AssetBundle val = cachedPackage.obj as AssetBundle;
            if (val != null)
            {
                Shader[] array = val.LoadAllAssets <Shader>();
                ShaderVariantCollection val2 = new ShaderVariantCollection();
                int i = 0;
                for (int num = array.Length; i < num; i++)
                {
                    if (!array[i].get_isSupported())
                    {
                        Log.Error("no support shader : " + array[i].get_name());
                    }
                    string name = array[i].get_name();
                    shaderCaches.Add(name, array[i]);
                    if (name.StartsWith("EeL") || name.Contains("effect"))
                    {
                        ShaderVariant val3 = default(ShaderVariant);
                        val3.shader = array[i];
                        val2.Add(val3);
                    }
                }
                if (!val2.get_isWarmedUp())
                {
                    val2.WarmUp();
                }
            }
        }
    }
    public PackageObject GetCachedPackage(string package_name)
    {
        PackageObject packageObject = packageCaches.Get(package_name);

        if (packageObject == null)
        {
            packageObject = systemPackageCaches.Get(package_name);
        }
        if (packageObject == null)
        {
            int i = 0;
            for (int size = deletePackageObjects.size; i < size; i++)
            {
                if (deletePackageObjects[i].name == package_name)
                {
                    packageObject = deletePackageObjects[i];
                    deletePackageObjects.RemoveAt(i);
                    packageCaches.Add(package_name, packageObject);
                    break;
                }
            }
        }
        return(packageObject);
    }
    private IEnumerator LoadScriptResources()
    {
        Transform camera_t = MonoBehaviourSingleton <AppMain> .I.mainCameraTransform;

        initCameraPos = camera_t.get_position();
        cameraPosAnim.Set(initCameraPos);
        LoadingQueue load_queue = new LoadingQueue(this);

        for (int cmd_row = 0; cmd_row < scriptCommands.Count; cmd_row++)
        {
            string cmd = scriptCommands[cmd_row].cmd;
            string p4  = scriptCommands[cmd_row].p0;
            string p3  = scriptCommands[cmd_row].p1;
            string p2  = scriptCommands[cmd_row].p2;
            switch (cmd)
            {
            case "EFF_SHOW":
            {
                LoadObject load_obj = load_queue.LoadEffect(RESOURCE_CATEGORY.EFFECT_ACTION, p4, false);
                effectPrefabs.Add(p4, load_obj);
                if (effectRenderTex == null)
                {
                    effectRenderTex = UIRenderTexture.Get(effectTex, -1f, true, 1);
                    effectRenderTex.Enable(0.25f);
                }
                break;
            }

            case "SE_PLAY":
                try
                {
                    int se_id = int.Parse(p4);
                    load_queue.CacheSE(se_id, null);
                }
                catch
                {
                    Log.Error(LOG.EXCEPTION, "{0}コマンドのSEIDに整数ではない値が指定されています。", cmd);
                }
                break;

            case "MSG":
                if (!string.IsNullOrEmpty(p2))
                {
                    try
                    {
                        int voice_id = int.Parse(p2);
                        load_queue.CacheVoice(voice_id, null);
                    }
                    catch
                    {
                        Log.Error(LOG.EXCEPTION, "{0}コマンドのボイスIDに整数ではない値が指定されています。", cmd);
                    }
                }
                break;

            case "CHR_LOAD":
            {
                int id = -1;
                for (int i = 0; (float)i < 4f; i++)
                {
                    if (charas.Find((StoryCharacter o) => o.id == ((_003CLoadScriptResources_003Ec__IteratorC1) /*Error near IL_02d5: stateMachine*/)._003Ci_003E__11) == null)
                    {
                        id = i;
                        break;
                    }
                }
                if (id != -1)
                {
                    UITexture ui_tex = eventReceiver.GetModelUITexture(id);
                    if (ui_tex != null)
                    {
                        StoryCharacter chara = StoryCharacter.Initialize(id, ui_tex, p4, p3, p2);
                        if (chara != null)
                        {
                            charas.Add(chara);
                        }
                    }
                }
                break;
            }
            }
        }
        while (MonoBehaviourSingleton <ResourceManager> .I.isLoading || InstantiateManager.isBusy)
        {
            yield return((object)null);
        }
        isLoading = false;
    }
    public SceneData CreateSceneData(string scene_name, TextAsset text_asset)
    {
        //IL_012e: Unknown result type (might be due to invalid IL or missing references)
        try
        {
            CSVReader cSVReader = new CSVReader(text_asset.get_text(), "name,type,useRes,loadRes,appVer,evName,evTo,retBtn,strKey,strJP", true);
            SceneData sceneData = new SceneData();
            sceneData.sceneName = scene_name;
            SectionData sectionData = null;
            string      text        = null;
            while (cSVReader.NextLine())
            {
                string value   = string.Empty;
                string value2  = string.Empty;
                string value3  = string.Empty;
                string value4  = string.Empty;
                string value5  = string.Empty;
                string value6  = string.Empty;
                string value7  = string.Empty;
                int    value8  = 0;
                string value9  = string.Empty;
                string value10 = string.Empty;
                cSVReader.Pop(ref value);
                cSVReader.Pop(ref value2);
                cSVReader.Pop(ref value3);
                cSVReader.Pop(ref value4);
                cSVReader.Pop(ref value5);
                cSVReader.Pop(ref value6);
                cSVReader.Pop(ref value7);
                cSVReader.Pop(ref value8);
                cSVReader.Pop(ref value9);
                cSVReader.Pop(ref value10);
                if (value.Length > 0)
                {
                    sectionData = new SectionData();
                    if (value == "SCENE")
                    {
                        value = scene_name + "Scene";
                    }
                    sectionData.sectionName = value;
                    if (text != null && value == text)
                    {
                        sectionData.isTop = true;
                        text = null;
                    }
                    if (value2.Length == 0)
                    {
                        throw new UnityException("scene table parse error");
                    }
                    sectionData.typeParams = value2.Split(new char[1]
                    {
                        ':'
                    }, StringSplitOptions.RemoveEmptyEntries);
                    try
                    {
                        sectionData.type = (GAME_SECTION_TYPE)(int)Enum.Parse(typeof(GAME_SECTION_TYPE), sectionData.typeParams[0]);
                    }
                    catch (Exception)
                    {
                        sectionData.type = GAME_SECTION_TYPE.COMMON_DIALOG;
                    }
                    sectionData.backButtonIndex = value8;
                    sceneData.sectionList.Add(sectionData);
                }
                if (value3.Length > 0)
                {
                    sectionData.useResourceList.Add(value3);
                }
                if (value4.Length > 0)
                {
                    if (sectionData.preloadResourceList == null)
                    {
                        sectionData.preloadResourceList = new List <string>();
                    }
                    sectionData.preloadResourceList.Add(value4);
                }
                if (value6.Length > 0 || value7.Length > 0)
                {
                    EventData eventData = new EventData();
                    eventData.appVer    = value5;
                    eventData.eventName = value6;
                    if (sectionData.type == GAME_SECTION_TYPE.SCENE && value6.Length == 0 && value7.Length > 0)
                    {
                        text = value7;
                    }
                    string[] array = value7.Split(':');
                    eventData.toSectionName = array[0];
                    eventData.closeType     = UITransition.TYPE.CLOSE;
                    eventData.openType      = UITransition.TYPE.OPEN;
                    int i = 1;
                    for (int num = array.Length; i < num; i++)
                    {
                        string text2 = array[i];
                        if (text2.Length == 3 && text2[1] == '>')
                        {
                            if (text2[0] == 'c')
                            {
                                eventData.closeType = UITransition.GetType(text2[2]);
                            }
                            else if (text2[0] == 'o')
                            {
                                eventData.openType = UITransition.GetType(text2[2]);
                            }
                        }
                    }
                    if (sectionData.eventDataList == null)
                    {
                        sectionData.eventDataList = new List <EventData>();
                    }
                    sectionData.eventDataList.Add(eventData);
                }
                if (value9.Length > 0 || value10.Length > 0)
                {
                    TextData textData = new TextData();
                    textData.key  = value9;
                    textData.text = value10;
                    if (sectionData.textList == null)
                    {
                        sectionData.textList = new List <TextData>();
                    }
                    sectionData.textList.Add(textData);
                }
            }
            sceneDataTable.Add(scene_name, sceneData);
            return(sceneData);

IL_038e:
            SceneData result;
            return(result);
        }
        catch (Exception exc)
        {
            Log.Exception(exc);
            return(null);

IL_03a4:
            SceneData result;
            return(result);
        }
    }