コード例 #1
0
 private void Awake()
 {
     //IL_000b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0010: Expected O, but got Unknown
     blurMaterial = new Material(ResourceUtility.FindShader("mobile/Custom/ImageEffect/RadialBlurFilter"));
     Restore();
 }
コード例 #2
0
 private void OnEnemyLoadFinished(Enemy o)
 {
     //IL_00a5: Unknown result type (might be due to invalid IL or missing references)
     OnLoadFinished();
     if (!(enemyLoader == null) && !(enemyLoader.body == null))
     {
         enemyLoader.body.GetComponentsInChildren <Renderer>(Temporary.rendererList);
         int i = 0;
         for (int count = Temporary.rendererList.Count; i < count; i++)
         {
             Renderer val = Temporary.rendererList[i];
             if (val is MeshRenderer || val is SkinnedMeshRenderer)
             {
                 Material[] materials = val.get_materials();
                 int        j         = 0;
                 for (int num = materials.Length; j < num; j++)
                 {
                     Material val2 = materials[j];
                     if (val2 != null)
                     {
                         string name = val2.get_shader().get_name();
                         if (name.Contains("cut"))
                         {
                             val2.set_shader(ResourceUtility.FindShader("Transparent/Cutout/Diffuse"));
                         }
                         else
                         {
                             if (name.Contains("_zako_"))
                             {
                                 val2.set_shader(ResourceUtility.FindShader(name + "__s"));
                             }
                             else if (CanChangeHighQualityShader(name))
                             {
                                 Shader val3 = ResourceUtility.FindShader("mobile/Custom/enemy_single_tex__no_cull");
                                 if (val2.HasProperty("_CullMode") && val2.GetInt("_CullMode") == 0 && val3 != null)
                                 {
                                     val2.set_shader(val3);
                                 }
                                 else
                                 {
                                     val2.set_shader(ResourceUtility.FindShader("mobile/Custom/enemy_single_tex__s"));
                                 }
                             }
                             if (enemyLoader.bodyID == 2023)
                             {
                                 val2.set_shader(ResourceUtility.FindShader("mobile/Custom/enemy_reflective_simple"));
                             }
                             else if (enemyLoader.bodyID == 2043)
                             {
                                 val2.set_shader(ResourceUtility.FindShader("mobile/Custom/enemy_reflective_for_shadow"));
                             }
                         }
                     }
                 }
             }
         }
         Temporary.rendererList.Clear();
     }
 }
コード例 #3
0
    private Material CreateMaterial(string shaderName)
    {
        //IL_0016: Unknown result type (might be due to invalid IL or missing references)
        //IL_001b: Expected O, but got Unknown
        Shader val = ResourceUtility.FindShader(shaderName);

        if (val == null)
        {
            return(null);
        }
        return(new Material(val));
    }
コード例 #4
0
 public static void ChangeWantUIShader(Renderer[] renderers)
 {
     Utility.MaterialForEach(renderers, delegate(Material material)
     {
         //IL_0001: Unknown result type (might be due to invalid IL or missing references)
         Shader val = ResourceUtility.FindShader(material.get_shader().get_name() + "__u");
         if (val != null)
         {
             material.set_shader(val);
         }
     });
 }
コード例 #5
0
    public static void ChangeLightShader(Transform root)
    {
        //IL_0058: Unknown result type (might be due to invalid IL or missing references)
        //IL_0092: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
        //IL_00d6: Expected O, but got Unknown
        UIntKeyTable <Material> uIntKeyTable = new UIntKeyTable <Material>();
        List <Renderer>         list         = new List <Renderer>();

        root.GetComponentsInChildren <Renderer>(true, list);
        int i = 0;

        for (int count = list.Count; i < count; i++)
        {
            Renderer   val             = list[i];
            Material[] sharedMaterials = val.get_sharedMaterials();
            int        j = 0;
            for (int num = sharedMaterials.Length; j < num; j++)
            {
                Material val2 = sharedMaterials[j];
                if (val2 != null && val2.get_shader() != null)
                {
                    Material val3 = uIntKeyTable.Get((uint)val2.GetInstanceID());
                    if (val3 != null)
                    {
                        sharedMaterials[j] = val3;
                    }
                    else
                    {
                        string name = val2.get_shader().get_name();
                        if (!name.EndsWith("__l"))
                        {
                            Shader val4 = ResourceUtility.FindShader(name + "__l");
                            if (val4 != null)
                            {
                                val3 = new Material(val2);
                                val3.set_shader(val4);
                                sharedMaterials[j] = val3;
                                uIntKeyTable.Add((uint)val2.GetInstanceID(), val3);
                                continue;
                            }
                        }
                        uIntKeyTable.Add((uint)val2.GetInstanceID(), val2);
                    }
                }
            }
            val.set_sharedMaterials(sharedMaterials);
        }
        uIntKeyTable.Clear();
        list.Clear();
    }
コード例 #6
0
 private void Awake()
 {
     //IL_0001: Unknown result type (might be due to invalid IL or missing references)
     //IL_0006: Unknown result type (might be due to invalid IL or missing references)
     //IL_0011: Unknown result type (might be due to invalid IL or missing references)
     //IL_001b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0020: Unknown result type (might be due to invalid IL or missing references)
     //IL_0034: Unknown result type (might be due to invalid IL or missing references)
     //IL_0049: Unknown result type (might be due to invalid IL or missing references)
     //IL_004e: Expected O, but got Unknown
     matrix = Matrix4x4.get_identity();
     matrix.SetTRS(Vector3.get_zero(), Quaternion.AngleAxis(90f, Vector3.get_right()), new Vector3(100f, 100f, 1f));
     alphaClearMaterial = new Material(ResourceUtility.FindShader("Custom/AlphaClear"));
 }
コード例 #7
0
 protected override void Awake()
 {
     //IL_0080: Unknown result type (might be due to invalid IL or missing references)
     //IL_0089: Expected O, but got Unknown
     base.Awake();
     targetCamera          = MonoBehaviourSingleton <AppMain> .I.mainCamera;
     targetCameraTransform = MonoBehaviourSingleton <AppMain> .I.mainCameraTransform;
     parameter             = MonoBehaviourSingleton <OutGameSettingsManager> .I.statusScene;
     uiTexture             = (Utility.CreateGameObjectAndComponent("UITexture", MonoBehaviourSingleton <UIManager> .I.system._transform, 5) as UITexture);
     uiTexture.shader      = ResourceUtility.FindShader("Unlit/ui_render_tex");
     uiTexture.SetAnchor(MonoBehaviourSingleton <UIManager> .I.system.get_gameObject(), 0, 0, 0, 0);
     uiTexture.UpdateAnchors();
     m_stSmithCharacter = (StatusSmithCharacter)Utility.CreateGameObjectAndComponent("StatusSmithCharacter", base._transform, -1);
 }
コード例 #8
0
    private static Material CreateMaterial()
    {
        //IL_000a: Unknown result type (might be due to invalid IL or missing references)
        //IL_000f: Expected O, but got Unknown
        //IL_0021: Unknown result type (might be due to invalid IL or missing references)
        //IL_0026: Expected O, but got Unknown
        //IL_0031: Unknown result type (might be due to invalid IL or missing references)
        Material val = new Material(ResourceUtility.FindShader("mobile/Custom/tex_color"));

        val.set_name("n6cw_mat");
        val.set_mainTexture(Resources.Load("Texture/White") as Texture);
        val.set_color(Color.get_clear());
        return(val);
    }
コード例 #9
0
    public AtlasEntry ReplaceAtlas(UISprite sprite, string shader)
    {
        //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
        //IL_0100: Expected O, but got Unknown
        if (null == sprite || null == sprite.atlas)
        {
            return(null);
        }
        AtlasEntry atlasEntry = atlases.Find(delegate(AtlasEntry o)
        {
            if (sprite.atlas.Equals((object)o.orgAtlas))
            {
                return(true);
            }
            return(false);
        });

        if (atlasEntry != null && (null == atlasEntry.copyAtlas || null == atlasEntry.orgAtlas))
        {
            atlases.Remove(atlasEntry);
            atlasEntry = null;
        }
        UIAtlas uIAtlas;

        if (atlasEntry == null)
        {
            uIAtlas = ((!(sprite.atlas.replacement != null)) ? ResourceUtility.Instantiate <UIAtlas>(sprite.atlas) : ResourceUtility.Instantiate <UIAtlas>(sprite.atlas.replacement));
            if (!(uIAtlas == null) && !(uIAtlas.spriteMaterial == null))
            {
                goto IL_00f4;
            }
            goto IL_00f4;
        }
        goto IL_0154;
IL_0154:
        atlasEntry.orgSpriteList.Add(sprite);
        sprite.atlas = atlasEntry.copyAtlas;
        return(atlasEntry);

IL_00f4:
        uIAtlas.spriteMaterial = new Material(uIAtlas.spriteMaterial);
        uIAtlas.spriteMaterial.set_shader(ResourceUtility.FindShader(shader));
        atlasEntry = new AtlasEntry(sprite.atlas, uIAtlas);
        atlases.Add(atlasEntry);
        uIAtlas.set_name("_" + sprite.atlas.get_name());
        goto IL_0154;
    }
コード例 #10
0
 public void Replace(string shaderName)
 {
     //IL_00c1: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c6: Expected O, but got Unknown
     //IL_010e: Unknown result type (might be due to invalid IL or missing references)
     if (!Object.op_Implicit(sprite))
     {
         Awake();
         if (!Object.op_Implicit(sprite))
         {
             return;
         }
     }
     if (entry != null)
     {
         entry.refCount--;
         entry = null;
     }
     if (atlases.TryGetValue(sprite.atlas, out entry) && !Object.op_Implicit(entry.atlas))
     {
         atlases.Remove(sprite.atlas);
         entry = null;
     }
     if (entry == null)
     {
         UIAtlas uIAtlas = ResourceUtility.Instantiate <UIAtlas>(sprite.atlas);
         uIAtlas.spriteMaterial = new Material(uIAtlas.spriteMaterial);
         uIAtlas.spriteMaterial.set_shader(ResourceUtility.FindShader(shaderName));
         entry = new AtlasEntry(uIAtlas);
         atlases.Add(sprite.atlas, entry);
         if (MonoBehaviourSingleton <AppMain> .IsValid())
         {
             uIAtlas.get_transform().set_parent(MonoBehaviourSingleton <AppMain> .I._transform);
         }
     }
     entry.refCount++;
     sprite.atlas = entry.atlas;
 }
コード例 #11
0
    protected void CheckAndReplaceShader(EnemyLoader enemyLoader)
    {
        Shader val = null;

        if (enemyLoader.bodyID == 2023)
        {
            val = ResourceUtility.FindShader("mobile/Custom/enemy_reflective_simple");
        }
        if (val != null)
        {
            enemyLoader.body.GetComponentsInChildren <Renderer>(Temporary.rendererList);
            for (int i = 0; i < Temporary.rendererList.Count; i++)
            {
                Renderer val2 = Temporary.rendererList[i];
                if (val2 is MeshRenderer || val2 is SkinnedMeshRenderer)
                {
                    for (int j = 0; j < val2.get_materials().Length; j++)
                    {
                        val2.get_materials()[j].set_shader(val);
                    }
                }
            }
        }
    }
コード例 #12
0
    private void SetupMaskSprite()
    {
        //IL_004d: Unknown result type (might be due to invalid IL or missing references)
        //IL_004f: Unknown result type (might be due to invalid IL or missing references)
        //IL_005a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0064: 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_0077: Unknown result type (might be due to invalid IL or missing references)
        //IL_008c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0097: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
        //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
        //IL_0139: Unknown result type (might be due to invalid IL or missing references)
        //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
        //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
        //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
        //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
        //IL_0200: Unknown result type (might be due to invalid IL or missing references)
        //IL_0207: Unknown result type (might be due to invalid IL or missing references)
        //IL_021c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0223: Unknown result type (might be due to invalid IL or missing references)
        //IL_0233: Unknown result type (might be due to invalid IL or missing references)
        //IL_0238: Unknown result type (might be due to invalid IL or missing references)
        //IL_0248: Unknown result type (might be due to invalid IL or missing references)
        //IL_024d: Unknown result type (might be due to invalid IL or missing references)
        //IL_029f: Unknown result type (might be due to invalid IL or missing references)
        //IL_02ae: Unknown result type (might be due to invalid IL or missing references)
        Shader       shader      = ResourceUtility.FindShader("mobile/Custom/ui_alpha_mask");
        Material     material    = GetMaterial(sprite.material, shader);
        UISpriteData atlasSprite = sprite.GetAtlasSprite();
        Rect         rect        = default(Rect);

        rect._002Ector((float)atlasSprite.x, (float)atlasSprite.y, (float)atlasSprite.width, (float)atlasSprite.height);
        Rect uvRect = NGUIMath.ConvertToTexCoords(rect, material.get_mainTexture().get_width(), material.get_mainTexture().get_height());

        maskSprite = new GameObject(sprite.get_name()).AddComponent <UITexture>();
        maskSprite.get_gameObject().set_layer(sprite.get_gameObject().get_layer());
        maskSprite.get_transform().set_parent(sprite.get_transform());
        maskSprite.get_transform().set_localPosition(Vector3.get_zero());
        maskSprite.get_transform().set_localScale(Vector3.get_one());
        maskSprite.depth    = sprite.depth + MASK_DEPTH;
        maskSprite.width    = sprite.width;
        maskSprite.height   = sprite.height;
        maskSprite.uvRect   = uvRect;
        maskSprite.material = material;
        if (Object.op_Implicit(maskingObject))
        {
            UISprite uISprite = maskingObject as UISprite;
            if (Object.op_Implicit(uISprite))
            {
                Shader       shader2      = ResourceUtility.FindShader("mobile/Custom/ui_add_depth_greater");
                Material     material2    = GetMaterial(uISprite.material, shader2);
                UISpriteData atlasSprite2 = uISprite.GetAtlasSprite();
                Rect         rect2        = default(Rect);
                rect2._002Ector((float)atlasSprite2.x, (float)atlasSprite2.y, (float)atlasSprite2.width, (float)atlasSprite2.height);
                Rect uvRect2 = NGUIMath.ConvertToTexCoords(rect2, material2.get_mainTexture().get_width(), material2.get_mainTexture().get_height());
                maskedSprite = new GameObject(uISprite.get_name()).AddComponent <UITexture>();
                maskedSprite.get_gameObject().set_layer(uISprite.get_gameObject().get_layer());
                maskedSprite.get_transform().set_parent(uISprite.get_transform());
                maskedSprite.get_transform().set_localPosition(Vector3.get_zero());
                maskedSprite.get_transform().set_localScale(Vector3.get_one());
                maskedSprite.depth    = sprite.depth + MASK_DEPTH + 1;
                maskedSprite.width    = uISprite.width;
                maskedSprite.height   = uISprite.height;
                maskedSprite.uvRect   = uvRect2;
                maskedSprite.color    = uISprite.color;
                maskedSprite.material = material2;
                uISprite.set_enabled(false);
            }
            else
            {
                maskingObject.depth = sprite.depth + MASK_DEPTH + 1;
            }
        }
        valid = true;
    }
コード例 #13
0
 private static Shader GetShader(string name)
 {
     return(ResourceUtility.FindShader(name));
 }
コード例 #14
0
 public static Shader ShaderFind(string name)
 {
     return(ResourceUtility.FindShader(name));
 }