© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
45 replies
Solace

❔ ✅ abstract-Parent and Child static overrides?

How do I redeclare an objects element which needs be from a static context in a child class?

I have an abstract parent class:
public abstract class ResizableGatePrefab : PrefabVariantInfo {
        //more things above
        private static Color24 color_t = new Color24(0,0,0);
        public Block prefabBlock = new Block { RawColor = color_t };
        //more things below
}
public abstract class ResizableGatePrefab : PrefabVariantInfo {
        //more things above
        private static Color24 color_t = new Color24(0,0,0);
        public Block prefabBlock = new Block { RawColor = color_t };
        //more things below
}

and some child classes (here's an example):
public class ResizableAndGatePrefab : ResizableGatePrefab {
        public static Color24 color_t = new Color24(127,127,127);
        public Block prefabBlock = new Block { RawColor = color_t };
        //more things below
}
public class ResizableAndGatePrefab : ResizableGatePrefab {
        public static Color24 color_t = new Color24(127,127,127);
        public Block prefabBlock = new Block { RawColor = color_t };
        //more things below
}

where in I'm trying to override
prefabBlock
prefabBlock
and want to give it a color
RawColor
RawColor
;
RawColor
RawColor
requires it's Color24 be static. I have been struggling with this massively.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ cast parent to child
C#CC# / help
4y ago
✅ Need help understanding parent and child views
C#CC# / help
2y ago
ASP.NET Page with child and parent
C#CC# / help
3y ago