cap5lut
cap5lut
CC#
Created by wyqsuy on 7/1/2024 in #help
✅CS1513 '}' expected
and usually u would probably make it readonly and set it its value directly public static readonly Quaternion DefaultRotate = ....;
27 replies
CC#
Created by wyqsuy on 7/1/2024 in #help
✅CS1513 '}' expected
public class PlayerMovement : MonoBehaviour
{
public static Quaternion defaultRotate;
private void Start()
{
// ...
}
private void Update()
{
// ...
}
}
public class PlayerMovement : MonoBehaviour
{
public static Quaternion defaultRotate;
private void Start()
{
// ...
}
private void Update()
{
// ...
}
}
27 replies
CC#
Created by wyqsuy on 7/1/2024 in #help
✅CS1513 '}' expected
u could also just make it a static field for PlayerMovement
27 replies
CC#
Created by wyqsuy on 7/1/2024 in #help
✅CS1513 '}' expected
the problem is actually the public static member in the Start() method, u can only declare members at class level
27 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
(im leaving #allow-unsafe-blocks out, because thats far beyond the advanced stuff)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
for relative short questions regarding C#, depending on topic, i either choose #help-0 or #advanced, if its going into more detail as in i have to explain a lot i create a thread in #help (just like we ended up here)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
the only questions regarding programming in #chat i ask are usually about naming, stuff like if WriteIf(...) or IfWrite(...) would be a better name. and out of the 5 ppl who respond u get around 10 opinions xD
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
tbh i think #chat is a bad place to ask questions, there is a lot of noise because ppl are chatting about everything in there. then there are quite sarcastic/trolling statements that are not beginner friendly and then also a lot of drift instead of staying at the topic (partially because the noise)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
its not about working for free, its about, if we spoon feed, u will come back with a similar question within the next days as well. we are lazy. its ur typical "give a man a fish and he is sated for a day, teach him how to fish and he is sated for a life time" (or something like that)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
basically follow the book, sometimes play around with what u learned so far, if u r stuck try to research for information to find solutions online and if all that didnt help, ask in communities like this server for further advice. we wont spoon feed u a working code either tho, but would be leading ya to the necessary information and help ya coming up with the solution. but the majority of work is still on u 🙂
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
try playing number guessing with them. that sort of reflects the quality of their answers. (spoiler: they are cheating!)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
tbh i only find them useful to rephrase documentational comments on what a method does, but thats it
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
The new ai suggestions [...]
not sure if u mean the code completion stuff like copilot or chatgpt. but generally u should avoid them. code completion ai is on the free tier garbage and not useful at all. chatgpt and alike to answer questions is even worse. LLMs spit out stuff that sounds valid at first glance, but is actually utterly senseless garbage as well. and even if either of that would spit out stuff thats actually correct, u wouldnt learn stuff, so its not helpful at all. if u continue after the beginner/intermediate stuff, u will find urself needing to solve problems where there is no tutorial/guide to help u through and u have to deal with it urself by the knowledge and experience u acquired and information u can gather in anyway (internet, forums, libraries, etc)
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
that book seems like to guide ya through the fundamentals, so it should be fine following that for now
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
and ofc 100% agreed on that part
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
generally speaking - tho i dunno anything about that book - work through it. game dev is a complex topic even if u dont take the math behind it into account. then maybe start with some small $projects to gain a bit experience and then dive into unity
37 replies
CC#
Created by 🖤Bronson🖤 on 6/29/2024 in #help
Newbie
getting started besides diving right into learning the programming language
how do u want to get started without learning the fundamental basics?
37 replies
CC#
Created by bakane on 6/26/2024 in #help
How to check if program is running as root on Linux
⤴️ will be lowered to
public static class C
{
public static bool IsRootUser()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
WindowsIdentity current = WindowsIdentity.GetCurrent();
try
{
return new WindowsPrincipal(current).IsInRole(WindowsBuiltInRole.Administrator);
}
finally
{
if (current != null)
{
((IDisposable)current).Dispose();
}
}
}
return <IsRootUser>g__geteuid|0_0() == 0;
}

[DllImport("libc", EntryPoint = "geteuid")]
[CompilerGenerated]
internal static extern uint <IsRootUser>g__geteuid|0_0();
}
public static class C
{
public static bool IsRootUser()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
WindowsIdentity current = WindowsIdentity.GetCurrent();
try
{
return new WindowsPrincipal(current).IsInRole(WindowsBuiltInRole.Administrator);
}
finally
{
if (current != null)
{
((IDisposable)current).Dispose();
}
}
}
return <IsRootUser>g__geteuid|0_0() == 0;
}

[DllImport("libc", EntryPoint = "geteuid")]
[CompilerGenerated]
internal static extern uint <IsRootUser>g__geteuid|0_0();
}
7 replies
CC#
Created by bakane on 6/26/2024 in #help
How to check if program is running as root on Linux
well, its an extern function, so it wont capture anything anyway
7 replies
CC#
Created by bakane on 6/26/2024 in #help
How to check if program is running as root on Linux
this should also work platform independent
public static bool IsRootUser()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
using (var identity = WindowsIdentity.GetCurrent())
{
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
}
else
{
return geteuid() == 0;

[DllImport("libc")]
static extern uint geteuid();
}
}
public static bool IsRootUser()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
using (var identity = WindowsIdentity.GetCurrent())
{
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
}
else
{
return geteuid() == 0;

[DllImport("libc")]
static extern uint geteuid();
}
}
7 replies