Solace
Solace
Explore posts from servers
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
!close
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
I found a solution
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Update() as the unity thing?
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Still (0,0,0) :c heck (well I already tried that so I'm not really surprised, just sad)
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
I should state, I believe much of this code I'm looking at is owned by some company
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
ClydeBot won't let me send the rest.
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Here's Color24 too, just in case: https://paste.mod.gg/odsfsmwgwths/0
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Note: the only code shown I wrote are in ResizableGatePrefab and ResizableAndGatePrefab
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
That one was easier to find:
public interface IRenderData {
Vector3 Position { get; }
Vector3 Rotation { get; }
Vector3 Scale { get; }
GpuColor Color { get; }
MaterialType Material { get; }
ColliderData ColliderData { get; }
Mesh Mesh { get; }
}
public interface IRenderData {
Vector3 Position { get; }
Vector3 Rotation { get; }
Vector3 Scale { get; }
GpuColor Color { get; }
MaterialType Material { get; }
ColliderData ColliderData { get; }
Mesh Mesh { get; }
}
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Lemme find IRenderData too-
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
Child:
public class ResizableAndGatePrefab : ResizableGatePrefab {
new public static Color24 color_t => new Color24(127,127,127);
new public Block prefabBlock => new Block { RawColor = color_t };
//more things after (not changing prefabBlock
}
public class ResizableAndGatePrefab : ResizableGatePrefab {
new public static Color24 color_t => new Color24(127,127,127);
new public Block prefabBlock => new Block { RawColor = color_t };
//more things after (not changing prefabBlock
}
Block:
public class Block : IRenderData {
public static Block Standard {
get { return new Block(); }
}

public Vector3 Position { get; set; } = Vector3.zero;

[SaveThis(SaveAs = "rotation")]
public Vector3 Rotation { get; set; } = Vector3.zero;

[SaveThis(SaveAs = "scale")]
public Vector3 Scale { get; set; } = Vector3.one;
public GpuColor Color {
get { return this.RawColor.ToGpuColor(); }
}

[SaveThis(SaveAs = "color")]
public Color24 RawColor { get; set; } = Colors.DefaultBlockColor;

[SaveThis(SaveAs = "material")]
public MaterialType Material { get; set; }

[SaveThis(SaveAs = "colliderData")]
public ColliderData ColliderData { get; set; } = ColliderData.Standard;

[DontSaveThis]
public Mesh Mesh {
get {
if (this._Mesh == null) {
this._Mesh = Meshes.FromString(this.MeshName);
}
return this._Mesh;
} set {
this._Mesh = value;
}
}

[SaveThis(SaveAs = "mesh")]
public string MeshName = "BetterCube";

private Mesh _Mesh;
}
public class Block : IRenderData {
public static Block Standard {
get { return new Block(); }
}

public Vector3 Position { get; set; } = Vector3.zero;

[SaveThis(SaveAs = "rotation")]
public Vector3 Rotation { get; set; } = Vector3.zero;

[SaveThis(SaveAs = "scale")]
public Vector3 Scale { get; set; } = Vector3.one;
public GpuColor Color {
get { return this.RawColor.ToGpuColor(); }
}

[SaveThis(SaveAs = "color")]
public Color24 RawColor { get; set; } = Colors.DefaultBlockColor;

[SaveThis(SaveAs = "material")]
public MaterialType Material { get; set; }

[SaveThis(SaveAs = "colliderData")]
public ColliderData ColliderData { get; set; } = ColliderData.Standard;

[DontSaveThis]
public Mesh Mesh {
get {
if (this._Mesh == null) {
this._Mesh = Meshes.FromString(this.MeshName);
}
return this._Mesh;
} set {
this._Mesh = value;
}
}

[SaveThis(SaveAs = "mesh")]
public string MeshName = "BetterCube";

private Mesh _Mesh;
}
This was under some random dll in the build
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
no matter which way I change the child to have new hidings and => expressions, it doesn't change the color.
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
They're still (0,0,0); I tried it with and without new's for hiding. I'll keep testing.
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
When I make it static, it works.. but every instance takes on the parent one (0,0,0)
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
"A field initializer cannot reference the non-static field" :c sad
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Failed to compile mod
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Error: (14,59): error CS0236: A field initializer cannot reference the non-static field, method, or property 'ResizableGatePrefab.color_t'
2023-03-27T17:32:15Z | INFO | [Random Debug Collection] Skipped 36 'mscorelib' warnings.
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Error: (14,59): error CS0236: A field initializer cannot reference the non-static field, method, or property 'ResizableGatePrefab.color_t'
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Failed to compile mod
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Error: (14,59): error CS0236: A field initializer cannot reference the non-static field, method, or property 'ResizableGatePrefab.color_t'
2023-03-27T17:32:15Z | INFO | [Random Debug Collection] Skipped 36 'mscorelib' warnings.
2023-03-27T17:32:15Z | ERROR | [Random Debug Collection] Error: (14,59): error CS0236: A field initializer cannot reference the non-static field, method, or property 'ResizableGatePrefab.color_t'
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
I can change it and show you the compile error, one sec
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
I wish I knew why color needed to be static too. the prefabBlock struct requires that RawColor be a static Color24.. for whatever reason. I don't like it either.
46 replies
CC#
Created by Solace on 3/27/2023 in #help
❔ ✅ abstract-Parent and Child static overrides?
46 replies