예제 #1
0
    private IEnumerator DoLoadHelm(EquipItemTable.EquipItemData data)
    {
        EquipModelTable.Data model_data = data.GetModelData(sexID);
        LoadObject           lo_head    = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_HEAD, ResourceName.GetPlayerHead(data.GetModelID(sexID)));
        LoadObject           lo_face    = null;

        if (model_data.needFace)
        {
            lo_face = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_FACE, ResourceName.GetPlayerFace(faceModelID));
        }
        yield return((object)loadingQueue.Wait());

        Transform head = lo_head.Realizes(_transform, _transform.get_gameObject().get_layer());

        head.set_localPosition(Vector3.get_zero());
        head.set_localRotation(Quaternion.get_identity());
        PlayerLoader.SetEquipColor(head, NGUIMath.IntToColor(data.modelColor0));
        nodeMain = head;
        yield return((object)this.StartCoroutine(InitRoopEffect(loadingQueue, head, SHADER_TYPE.NORMAL)));

        if (lo_face != null)
        {
            Transform face = lo_face.Realizes(head, _transform.get_gameObject().get_layer());
            _SetMannequinMaterial(face);
        }
        displayInfo = MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.helmDisplayInfo;
        OnLoadFinished();
    }
예제 #2
0
    private IEnumerator DoLoadWeapon(EquipItemTable.EquipItemData data)
    {
        int    modelID = data.GetModelID(sexID);
        string name    = ResourceName.GetPlayerWeapon(modelID);
        byte   highTex = 0;

        if (MonoBehaviourSingleton <GlobalSettingsManager> .IsValid())
        {
            EquipModelHQTable hqTable = MonoBehaviourSingleton <GlobalSettingsManager> .I.equipModelHQTable;
            highTex = hqTable.GetWeaponFlag(modelID);
        }
        LoadObject lo = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_WEAPON, name);
        LoadObject lo_high_reso_tex = PlayerLoader.LoadHighResoTexs(loadingQueue, name, highTex);

        yield return((object)loadingQueue.Wait());

        Transform weapon = lo.Realizes(_transform, _transform.get_gameObject().get_layer());

        weapon.set_localPosition(Vector3.get_zero());
        weapon.set_localRotation(Quaternion.get_identity());
        Renderer[] renderers = weapon.GetComponentsInChildren <Renderer>();
        PlayerLoader.SetEquipColor3(renderers, NGUIMath.IntToColor(data.modelColor0), NGUIMath.IntToColor(data.modelColor1), NGUIMath.IntToColor(data.modelColor2));
        Material materialR = null;
        Material materialL = null;
        int      j         = 0;

        for (int i = renderers.Length; j < i; j++)
        {
            Renderer r = renderers[j];
            if (r.get_name().EndsWith("_L"))
            {
                materialL = r.get_material();
                nodeSub   = r.get_transform();
            }
            else
            {
                materialR = r.get_material();
                nodeMain  = r.get_transform();
            }
        }
        yield return((object)this.StartCoroutine(InitRoopEffect(loadingQueue, weapon, SHADER_TYPE.NORMAL)));

        PlayerLoader.ApplyWeaponHighResoTexs(lo_high_reso_tex, highTex, materialR, materialL);
        displayInfo = new GlobalSettingsManager.UIModelRenderingParam.DisplayInfo(MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.WeaponDisplayInfos[(int)data.type]);
        if (data.id == 50020201 || data.id == 50020200)
        {
            displayInfo.mainPos    = new Vector3(0f, 0f, -0.21f);
            displayInfo.mainRot.x += 180f;
            displayInfo.subRot.x  += 180f;
        }
        if (data.id == 60020200 || data.id == 60020201 || data.id == 60020202)
        {
            displayInfo.mainPos = new Vector3(0f, 0f, 0f);
            displayInfo.mainRot = new Vector3(-64.50903f, 93.68915f, -118.1268f);
        }
        OnLoadFinished();
    }
예제 #3
0
    private IEnumerator DoLoadSkillItemSymbol(SkillItemTable.SkillItemData data)
    {
        LoadObject lo = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.ITEM_MODEL, ResourceName.GetSkillItemSymbolModel(data.iconID));

        yield return((object)loadingQueue.Wait());

        Transform item = lo.Realizes(_transform, _transform.get_gameObject().get_layer());

        item.set_localPosition(Vector3.get_zero());
        item.set_localRotation(Quaternion.get_identity());
        nodeMain    = item;
        displayInfo = MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.itemDisplayInfo;
        OnLoadFinished();
    }
예제 #4
0
 private void SaveSettings(GlobalSettingsManager.UIModelRenderingParam.DisplayInfo info, Transform root)
 {
     //IL_0019: Unknown result type (might be due to invalid IL or missing references)
     //IL_001e: Expected O, but got Unknown
     //IL_002e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0033: Unknown result type (might be due to invalid IL or missing references)
     //IL_0046: Unknown result type (might be due to invalid IL or missing references)
     //IL_004b: Expected O, but got Unknown
     //IL_0052: Unknown result type (might be due to invalid IL or missing references)
     //IL_0057: Expected O, but got Unknown
     //IL_0066: Unknown result type (might be due to invalid IL or missing references)
     //IL_006b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0072: Unknown result type (might be due to invalid IL or missing references)
     //IL_0077: Unknown result type (might be due to invalid IL or missing references)
     //IL_008a: Unknown result type (might be due to invalid IL or missing references)
     //IL_008f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0096: Unknown result type (might be due to invalid IL or missing references)
     //IL_009b: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
     if (info != null && !(root == null))
     {
         Transform val = root.Find("Pivot");
         if (!(val == null))
         {
             Vector3 localPosition = val.get_localPosition();
             info.zFromCamera = localPosition.z;
             Transform val2 = root.Find("Pivot/Model0");
             Transform val3 = root.Find("Pivot/Model1");
             if (val2 != null)
             {
                 info.mainPos = val2.get_localPosition();
                 info.mainRot = val2.get_localEulerAngles();
             }
             if (val3 != null)
             {
                 info.subPos = val3.get_localPosition();
                 info.subRot = val3.get_localEulerAngles();
             }
             else
             {
                 info.subPos = Vector3.get_zero();
                 info.subRot = Vector3.get_zero();
             }
         }
     }
 }
예제 #5
0
 private void LoadSettings(GlobalSettingsManager.UIModelRenderingParam.DisplayInfo info, Transform root)
 {
     //IL_0019: Unknown result type (might be due to invalid IL or missing references)
     //IL_001e: Expected O, but got Unknown
     //IL_002d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0038: Unknown result type (might be due to invalid IL or missing references)
     //IL_0043: Unknown result type (might be due to invalid IL or missing references)
     //IL_005e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0069: Unknown result type (might be due to invalid IL or missing references)
     //IL_0074: Unknown result type (might be due to invalid IL or missing references)
     //IL_0084: Unknown result type (might be due to invalid IL or missing references)
     //IL_0089: Expected O, but got Unknown
     //IL_0090: Unknown result type (might be due to invalid IL or missing references)
     //IL_0095: Expected O, but got Unknown
     //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b0: Unknown result type (might be due to invalid IL or missing references)
     //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
     //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
     //IL_00df: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
     if (info != null && !(root == null))
     {
         Transform val = root.Find("Pivot");
         if (!(val == null))
         {
             root.set_localPosition(Vector3.get_zero());
             root.set_localEulerAngles(Vector3.get_zero());
             root.set_localScale(Vector3.get_one());
             val.set_localPosition(new Vector3(0f, 0f, info.zFromCamera));
             val.set_localEulerAngles(Vector3.get_zero());
             val.set_localScale(Vector3.get_one());
             Transform val2 = root.Find("Pivot/Model0");
             Transform val3 = root.Find("Pivot/Model1");
             if (val2 != null)
             {
                 val2.set_localPosition(info.mainPos);
                 val2.set_localEulerAngles(info.mainRot);
                 val2.set_localScale(Vector3.get_one());
             }
             if (val3 != null)
             {
                 val3.set_localPosition(info.subPos);
                 val3.set_localEulerAngles(info.subRot);
                 val3.set_localScale(Vector3.get_one());
             }
         }
     }
 }
예제 #6
0
    private IEnumerator DoLoadFullBody(EquipItemTable.EquipItemData data)
    {
        EquipModelTable.Data model_data = data.GetModelData(sexID);
        bool       is_bdy          = data.type == EQUIPMENT_TYPE.ARMOR || data.type == EQUIPMENT_TYPE.VISUAL_ARMOR;
        bool       is_arm          = data.type == EQUIPMENT_TYPE.ARM || data.type == EQUIPMENT_TYPE.VISUAL_ARM;
        bool       is_leg          = data.type == EQUIPMENT_TYPE.LEG || data.type == EQUIPMENT_TYPE.VISUAL_LEG;
        int        sex_id          = sexID;
        int        face_id         = faceModelID;
        int        hair_id         = -1;
        int        body_id         = (!is_bdy) ? MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.mannequinBodyIDs[sex_id] : data.GetModelID(sex_id);
        int        arm_id          = (!is_arm) ? (-1) : data.GetModelID(sex_id);
        int        leg_id          = (!is_leg) ? MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.mannequinLegIDs[sex_id] : data.GetModelID(sex_id);
        Color      mannequin_color = MonoBehaviourSingleton <GlobalSettingsManager> .I.playerVisual.mannequinSkinColor;
        Color      skin_color      = mannequin_color;
        Color      hair_color      = mannequin_color;
        Color      equip_color     = NGUIMath.IntToColor(data.modelColor0);
        LoadObject lo_face         = (!model_data.needFace) ? null : loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_FACE, ResourceName.GetPlayerFace(face_id));
        LoadObject lo_hair         = (hair_id <= -1) ? null : loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_HEAD, ResourceName.GetPlayerHead(hair_id));
        LoadObject lo_body         = loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_BDY, ResourceName.GetPlayerBody(body_id));
        LoadObject lo_arm          = (!model_data.needArm || arm_id <= -1) ? null : loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_ARM, ResourceName.GetPlayerArm(arm_id));
        LoadObject lo_leg          = (!model_data.needLeg || leg_id <= -1) ? null : loadingQueue.LoadAndInstantiate(RESOURCE_CATEGORY.PLAYER_LEG, ResourceName.GetPlayerLeg(leg_id));

        yield return((object)loadingQueue.Wait());

        Transform body = lo_body.Realizes(_transform, _transform.get_gameObject().get_layer());

        body.set_localPosition(Vector3.get_zero());
        body.set_localRotation(Quaternion.get_identity());
        PlayerLoader.SetSkinAndEquipColor(body, skin_color, (!is_bdy) ? mannequin_color : equip_color, 0f);
        if (!is_bdy)
        {
            _SetMannequinMaterial(body);
        }
        else
        {
            yield return((object)this.StartCoroutine(InitRoopEffect(loadingQueue, body, SHADER_TYPE.NORMAL)));
        }
        nodeMain = body;
        SkinnedMeshRenderer body_skin  = body.GetComponentInChildren <SkinnedMeshRenderer>();
        Transform           head_node  = Utility.Find(body, "Head");
        Transform           L_Upperarm = Utility.Find(body, "L_Upperarm");
        Transform           R_Upperarm = Utility.Find(body, "R_Upperarm");

        if (L_Upperarm != null && R_Upperarm != null)
        {
            Vector3 angle = L_Upperarm.get_localEulerAngles();
            angle.y = -40f;
            L_Upperarm.set_localEulerAngles(angle);
            angle   = R_Upperarm.get_localEulerAngles();
            angle.y = -40f;
            R_Upperarm.set_localEulerAngles(angle);
        }
        if (lo_face != null)
        {
            Transform face = lo_face.Realizes(head_node, _transform.get_gameObject().get_layer());
            PlayerLoader.SetSkinColor(face, skin_color);
            _SetMannequinMaterial(face);
        }
        if (lo_hair != null)
        {
            Transform hair = lo_hair.Realizes(head_node, _transform.get_gameObject().get_layer());
            PlayerLoader.SetEquipColor(hair, hair_color);
            _SetMannequinMaterial(hair);
        }
        if (lo_arm != null)
        {
            Transform arm = PlayerLoader.AddSkin(lo_arm, body_skin, _transform.get_gameObject().get_layer());
            PlayerLoader.SetSkinAndEquipColor(arm, skin_color, (!is_arm) ? mannequin_color : equip_color, (!is_arm) ? 0.0001f : model_data.GetZBias());
            if (is_arm)
            {
                PlayerLoader.InvisibleBodyTriangles(model_data.bodyDraw, body_skin);
            }
            if (!is_arm)
            {
                _SetMannequinMaterial(arm);
            }
        }
        if (lo_leg != null)
        {
            Transform leg = PlayerLoader.AddSkin(lo_leg, body_skin, _transform.get_gameObject().get_layer());
            PlayerLoader.SetSkinAndEquipColor(leg, skin_color, (!is_leg) ? mannequin_color : equip_color, (!is_leg) ? 0.0001f : model_data.GetZBias());
            if (!is_leg)
            {
                _SetMannequinMaterial(leg);
            }
        }
        if (is_bdy)
        {
            displayInfo = MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.armorDisplayInfo;
        }
        else if (is_arm)
        {
            displayInfo = MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.armDisplayInfo;
        }
        else if (is_leg)
        {
            displayInfo = MonoBehaviourSingleton <GlobalSettingsManager> .I.uiModelRendering.legDisplayInfo;
        }
        OnLoadFinished();
    }