Пример #1
0
            public bool MoveNext()
            {
                uint num = (uint)this.$PC;

                this.$PC = -1;
                bool flag = false;

                switch (num)
                {
                case 0u:
                    enumerator = base.< GetGizmos > __BaseCallProxy0().GetEnumerator();
                    num        = 4294967293u;
                    break;

                case 1u:
                    break;

                case 2u:
                    this.$PC = -1;
                    return(false);

                default:
                    return(false);
                }
                try
                {
                    switch (num)
                    {
                    }
                    if (enumerator.MoveNext())
                    {
                        c             = enumerator.Current;
                        this.$current = c;
                        if (!this.$disposing)
                        {
                            this.$PC = 1;
                        }
                        flag = true;
                        return(true);
                    }
                }
                finally
                {
                    if (!flag)
                    {
                        if (enumerator != null)
                        {
                            enumerator.Dispose();
                        }
                    }
                }
                Command_Action com = new Command_Action();

                com.defaultLabel = "CommandCancelConstructionLabel".Translate();
                com.defaultDesc  = "CommandCancelConstructionDesc".Translate();
                com.icon         = ContentFinder <Texture2D> .Get("UI/Designators/Cancel", true);

                com.hotKey = KeyBindingDefOf.Designator_Cancel;
                com.action = delegate()
                {
                    this.Destroy(DestroyMode.Cancel);
                };
                this.$current = com;
                if (!this.$disposing)
                {
                    this.$PC = 2;
                }
                return(true);
            }
        public override void Init(GraphicRequest req)
        {
            this.data     = req.graphicData;
            this.path     = req.path;
            this.color    = req.color;
            this.colorTwo = req.colorTwo;
            this.drawSize = req.drawSize;
            Texture2D[] array = new Texture2D[4];
            array[0] = ContentFinder <Texture2D> .Get(req.path + "_back", false);

            if (array[0] == null)
            {
                Log.Error("Failed to find any texture while constructing " + this);
                return;
            }
            array[1] = ContentFinder <Texture2D> .Get(req.path + "_side", false);

            if (array[1] == null)
            {
                array[1] = array[0];
            }
            array[2] = ContentFinder <Texture2D> .Get(req.path + "_front", false);

            if (array[2] == null)
            {
                array[2] = array[0];
            }
            array[3] = ContentFinder <Texture2D> .Get(req.path + "_side2", false);

            if (array[3] == null)
            {
                array[3] = array[1];
            }

            Texture2D[] array2 = new Texture2D[4];
            if (req.shader.SupportsMaskTex())
            {
                array2[0] = ContentFinder <Texture2D> .Get(req.path + "_backm", false);

                if (array2[0] == null)
                {
                    array2[0] = FaceTextures.RedTexture;
                }
                array2[1] = ContentFinder <Texture2D> .Get(req.path + "_sidem", false);

                if (array2[1] == null)
                {
                    array2[1] = FaceTextures.RedTexture;
                }
                array2[2] = ContentFinder <Texture2D> .Get(req.path + "_frontm", false);

                if (array2[2] == null)
                {
                    array2[2] = FaceTextures.RedTexture;
                }
                array2[3] = ContentFinder <Texture2D> .Get(req.path + "_side2m", false);

                if (array2[3] == null)
                {
                    array2[3] = FaceTextures.RedTexture;
                }
            }
            for (int i = 0; i < 4; i++)
            {
                MaterialRequest req2 = default;
                req2.mainTex  = array[i];
                req2.shader   = req.shader;
                req2.color    = this.color;
                req2.colorTwo = this.colorTwo;
                req2.maskTex  = array2[i];
                this.mats[i]  = MaterialPool.MatFrom(req2);
            }
        }
Пример #3
0
 private void <ResolveReferences> m__0()
 {
     this.clip = ContentFinder <AudioClip> .Get(this.clipPath, true);
 }
Пример #4
0
        public override void Init(GraphicRequest req)
        {
            data     = req.graphicData;
            path     = req.path;
            color    = req.color;
            colorTwo = req.colorTwo;
            drawSize = req.drawSize;
            Texture2D[] array = new Texture2D[mats.Length];
            array[0] = ContentFinder <Texture2D> .Get(req.path + "_north", reportFailure : false);

            array[1] = ContentFinder <Texture2D> .Get(req.path + "_east", reportFailure : false);

            array[2] = ContentFinder <Texture2D> .Get(req.path + "_south", reportFailure : false);

            array[3] = ContentFinder <Texture2D> .Get(req.path + "_west", reportFailure : false);

            if (array[0] == null)
            {
                if (array[2] != null)
                {
                    array[0] = array[2];
                    drawRotatedExtraAngleOffset = 180f;
                }
                else if (array[1] != null)
                {
                    array[0] = array[1];
                    drawRotatedExtraAngleOffset = -90f;
                }
                else if (array[3] != null)
                {
                    array[0] = array[3];
                    drawRotatedExtraAngleOffset = 90f;
                }
                else
                {
                    array[0] = ContentFinder <Texture2D> .Get(req.path, reportFailure : false);
                }
            }
            if (array[0] == null)
            {
                Log.Error("Failed to find any textures at " + req.path + " while constructing " + this.ToStringSafe());
                return;
            }
            if (array[2] == null)
            {
                array[2] = array[0];
            }
            if (array[1] == null)
            {
                if (array[3] != null)
                {
                    array[1]    = array[3];
                    eastFlipped = base.DataAllowsFlip;
                }
                else
                {
                    array[1] = array[0];
                }
            }
            if (array[3] == null)
            {
                if (array[1] != null)
                {
                    array[3]    = array[1];
                    westFlipped = base.DataAllowsFlip;
                }
                else
                {
                    array[3] = array[0];
                }
            }
            Texture2D[] array2 = new Texture2D[mats.Length];
            if (req.shader.SupportsMaskTex())
            {
                array2[0] = ContentFinder <Texture2D> .Get(req.path + "_northm", reportFailure : false);

                array2[1] = ContentFinder <Texture2D> .Get(req.path + "_eastm", reportFailure : false);

                array2[2] = ContentFinder <Texture2D> .Get(req.path + "_southm", reportFailure : false);

                array2[3] = ContentFinder <Texture2D> .Get(req.path + "_westm", reportFailure : false);

                if (array2[0] == null)
                {
                    if (array2[2] != null)
                    {
                        array2[0] = array2[2];
                    }
                    else if (array2[1] != null)
                    {
                        array2[0] = array2[1];
                    }
                    else if (array2[3] != null)
                    {
                        array2[0] = array2[3];
                    }
                }
                if (array2[2] == null)
                {
                    array2[2] = array2[0];
                }
                if (array2[1] == null)
                {
                    if (array2[3] != null)
                    {
                        array2[1] = array2[3];
                    }
                    else
                    {
                        array2[1] = array2[0];
                    }
                }
                if (array2[3] == null)
                {
                    if (array2[1] != null)
                    {
                        array2[3] = array2[1];
                    }
                    else
                    {
                        array2[3] = array2[0];
                    }
                }
            }
            for (int i = 0; i < mats.Length; i++)
            {
                MaterialRequest req2 = default(MaterialRequest);
                req2.mainTex          = array[i];
                req2.shader           = req.shader;
                req2.color            = color;
                req2.colorTwo         = colorTwo;
                req2.maskTex          = array2[i];
                req2.shaderParameters = req.shaderParameters;
                mats[i] = MaterialPool.MatFrom(req2);
            }
        }
Пример #5
0
        public static Material MatFrom(string texPath, Shader shader, Color color)
        {
            MaterialRequest req = new MaterialRequest(ContentFinder <Texture2D> .Get(texPath, true), shader, color);

            return(MaterialPool.MatFrom(req));
        }
Пример #6
0
        public override void Init(GraphicRequest req)
        {
            base.data     = req.graphicData;
            base.path     = req.path;
            base.color    = req.color;
            base.colorTwo = req.colorTwo;
            base.drawSize = req.drawSize;
            Texture2D[] array = new Texture2D[3]
            {
                ContentFinder <Texture2D> .Get(req.path + "_back", false),
                null,
                null
            };
            if ((Object)array[0] == (Object)null)
            {
                Log.Error("Failed to find any texture while constructing " + this.ToString());
            }
            else
            {
                array[1] = ContentFinder <Texture2D> .Get(req.path + "_side", false);

                if ((Object)array[1] == (Object)null)
                {
                    array[1] = array[0];
                }
                array[2] = ContentFinder <Texture2D> .Get(req.path + "_front", false);

                if ((Object)array[2] == (Object)null)
                {
                    array[2] = array[0];
                }
                Texture2D[] array2 = new Texture2D[3];
                if (req.shader.SupportsMaskTex())
                {
                    array2[0] = ContentFinder <Texture2D> .Get(req.path + "_backm", false);

                    if ((Object)array2[0] != (Object)null)
                    {
                        array2[1] = ContentFinder <Texture2D> .Get(req.path + "_sidem", false);

                        if ((Object)array2[1] == (Object)null)
                        {
                            array2[1] = array2[0];
                        }
                        array2[2] = ContentFinder <Texture2D> .Get(req.path + "_frontm", false);

                        if ((Object)array2[2] == (Object)null)
                        {
                            array2[2] = array2[0];
                        }
                    }
                }
                for (int i = 0; i < 3; i++)
                {
                    MaterialRequest req2 = default(MaterialRequest);
                    req2.mainTex  = array[i];
                    req2.shader   = req.shader;
                    req2.color    = base.color;
                    req2.colorTwo = base.colorTwo;
                    req2.maskTex  = array2[i];
                    this.mats[i]  = MaterialPool.MatFrom(req2);
                }
            }
        }
Пример #7
0
 public static Material MatFrom(string texPath, Shader shader, Color color)
 {
     return(MatFrom(new MaterialRequest(ContentFinder <Texture2D> .Get(texPath), shader, color)));
 }
 private void <PostLoad> m__0()
 {
     this.icon = ContentFinder <Texture2D> .Get(this.iconPath, true);
 }