ThatDaniel
ThatDaniel
CC#
Created by ℍ𝕖𝕩 on 8/10/2024 in #help
Why i can't insert values in private arrays?
Do you know the difference between static and instance?
5 replies
CC#
Created by Alex on 3/30/2024 in #help
How to deserialize only child object
they didnt want to do that
9 replies
CC#
Created by Alex on 3/30/2024 in #help
How to deserialize only child object
Using System.Text.Json.Nodes or you can use another json package but I like this syntax
9 replies
CC#
Created by Alex on 3/30/2024 in #help
How to deserialize only child object
9 replies
CC#
Created by Alex on 3/30/2024 in #help
How to deserialize only child object
var json = @"{
""props"":{
""pageProps"": {
""dehydratedReduxStateKey"": {
""studyModesCommon"": {
""studiableData"": {
""studiableItems"": [
{""item1"": ""data1""},
{""item2"": ""data2""},
{""item3"": ""data3""}
]
}
}
}
}
}
}";

var jsonNode = JsonNode.Parse(json);
var studiableItems = jsonNode["props"]["pageProps"]["dehydratedReduxStateKey"]["studyModesCommon"]["studiableData"]["studiableItems"];

Console.WriteLine(studiableItems.ToJsonString());
var json = @"{
""props"":{
""pageProps"": {
""dehydratedReduxStateKey"": {
""studyModesCommon"": {
""studiableData"": {
""studiableItems"": [
{""item1"": ""data1""},
{""item2"": ""data2""},
{""item3"": ""data3""}
]
}
}
}
}
}
}";

var jsonNode = JsonNode.Parse(json);
var studiableItems = jsonNode["props"]["pageProps"]["dehydratedReduxStateKey"]["studyModesCommon"]["studiableData"]["studiableItems"];

Console.WriteLine(studiableItems.ToJsonString());
9 replies
CC#
Created by bl4ck on 3/9/2024 in #help
Can't use | operator in case?
or
case 1:
case 7:
int offset = 0;
//rest of code...
case 1:
case 7:
int offset = 0;
//rest of code...
8 replies
CC#
Created by bl4ck on 3/9/2024 in #help
Can't use | operator in case?
You can change it to
case 1 or 7:
int offset = 0;
//rest of code...
case 1 or 7:
int offset = 0;
//rest of code...
8 replies
CC#
Created by bl4ck on 3/9/2024 in #help
Can't use | operator in case?
I think it's doing a bitwise operation
8 replies
CC#
Created by BananaCruz on 1/21/2024 in #help
Unity Snake Game Error
and it'd tell you if you are using a Unity magic function correctly (Like OntriggerEnter2D)
9 replies
CC#
Created by BananaCruz on 1/21/2024 in #help
Unity Snake Game Error
If you configure your IDE for Unity you'll get red underlining for compile errors
9 replies
CC#
Created by GABRIEL22 on 1/15/2024 in #help
System.NullReferenceException: Object reference not set to an instance of an object.
GetSubjectById is returning null then, whats the code for GetSubjectById ?
16 replies
CC#
Created by LeNoX on 1/11/2024 in #help
Getting a random number from 1 to 10
just fyi that will get you 1-9 as the second parameter is exclusive if you actually want to get 10 as a possibility then you'd need Random.Shared.Next(1, 11);
10 replies
CC#
Created by Unc on 1/6/2024 in #help
can someone give me an example of what “return” does and how to use it?
55 replies
CC#
Created by HD-Fr0sT on 1/1/2024 in #help
How many unity exclusive functions and methods are there?
that's the inbuilt stuff so not including packages
5 replies
CC#
Created by HD-Fr0sT on 1/1/2024 in #help
How many unity exclusive functions and methods are there?
5 replies
CC#
Created by HD-Fr0sT on 1/1/2024 in #help
How many unity exclusive functions and methods are there?
a lot
5 replies
CC#
Created by soujanya on 12/17/2023 in #help
error cs8802 vs code ide
e.g
//Inside Program.cs file:

var script = new Script1();
script.Thing();

//Inside Script1.cs file:

public class Script1
{
public void Thing()
{
//code here
}
}
//Inside Program.cs file:

var script = new Script1();
script.Thing();

//Inside Script1.cs file:

public class Script1
{
public void Thing()
{
//code here
}
}
11 replies
CC#
Created by soujanya on 12/17/2023 in #help
error cs8802 vs code ide
all other code needs to be in methods inside classes/structs
11 replies
CC#
Created by soujanya on 12/17/2023 in #help
error cs8802 vs code ide
you can only lay code out like that in one file (generally the Program.cs)
11 replies