c#

Working with event Action, unsubscribing from the event

public event Action<GameObject> SelectCallbackMethods; void Start() { SelectCallbackMethods += (obj) => Charact ... += handler; } void OnMouseUp() { SelectCallbackMethods.Invoke(this.gameObject); SelectCallbackMethods -= handler; }

C# GUI application for Linux

A similar question seems to have been 3 years ago, but maybe something has already changed... MS Visual Studio 2017 Enterpri ... is the application under Linux that is the task. Does Visual Studio 2017 Enterprise Edition support the C# GUI for Linux ?

Unity random appearance of images

Good afternoon, sooooo need some help)) Now I'm writing a layout in Unity, there are 8 pictures with arrows, I want them to ... appears behind it , I don't know how to do it ((I only managed to deal with timerbar, I ask for help, Thank you very much!!

How do I move an object in a certain direction, regardless of where it is turned?

There is an object, it moves in a certain direction like this: transform.Translate(0,0,speedTime.deltaTime); There is a secon ... getting the coordinates of the first object and assigning it to the second one is not veren, you need exactly the direction.

C# TCP console server: how to accept commands and their data from Unity clients

Help people! in C#, I want to write a console TCP server for many unity clients, who knows if the correct way to accept serialized data and process it in this way is through a switch? How can I accept both the command and the data in the same thread?

ASP NET.CORE MVC Dynamic Creation

I'm writing a quizzer site. Faced with such a problem. There is a certain survey, with the nth number of questions, you need to click on the button, add a new field for a new question(more tautology, tautology), Example: And we get this result

Creating a map generator from 3d tiles on Unity

I make a similar game Pixel Dungeon, only in the 3d version. I started with the dungeon generator. The idea is that there is ... re elegant solutions for a long time, but I haven't been able to find what I need yet. fits. Please show me the way. Thanks.

Creating a class object in WindowsForms C#

Creating a separate class in the project, conditionally public class A{ String b; A(String b){this.b=b;} } Then I try to cre ... A abc = new A("s"); And the result is an error that the class is unavailable due to its security level, how can I fix this ?

The difference between override and virtual

Please help me figure it out. I reread the documentation for a long time, and the network only compares new and override.

How do I call a form in C#?

Hi everyone. I wrote an ftp, created a form, made buttons, and prescribed functions for the buttons. At first it was without ... Click(object sender, EventArgs e) { newFtpManager.DeleteFile("ftp://yourdomain.com/file.exe"); } } }

What is IntPtr?

Why do I need it and how do I use it? What does the following entry mean? IntPtr pin, pout;

infinite 2D background animation (C# unity)

I want to make a background animation in a simple 2D game, so that when you press the movement keys, the background starts mo ... terial.mainTextureOffset = offsetTexture; lastpos = gg.transform.position.x; } } But it didn't work.

How to encrypt and decrypt.txt file?

I have a part of the code that records incoming values in a text file of the program: public int writeData() { S ... n at the read stage (readContent function)? I am very far from the topic of data encryption, so I asked for help on the forum

C# Hex to string

I translate the string to Hex like this:textBox3.Text = String.Concat(login.Select(x => ((int)x).ToString("x"))); And how can it be translated back into text? Tell me please.

Unit Test (MSTest). C#

Please help me in the initial stages of studying unit tests. I'm writing them for the first time. There is such a method: pub ... ectedfourthPair, FindGCD.GCDByEuclid(fourthPair.Item1, fourthPair.Item2)); } } Tell me where to remove/add/change what.

Start and stop threads sequentially (BackgroundWorker)

Good afternoon. How is it possible to ensure that the first thread completes first, then the second, third, etc., i.e., compl ... static void RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { countdown.Signal(); } }

How do I use X. 509 certificates?

Let's say I want to write 2 console programs: client and server. I will create self-signed certificates, install them on the ... omes from the server itself or to link programs with certificates, you can use cmd and the OS will check everything itself?

How do I sync?

Good time of day. The bottom line is this: there are clients (Windows applications) and you need to synchronize data on them. ... on is how to do it correctly. p. s. - the load is not large, so I assume that SignalR and the API will be on the same server.

Autofac: resolver of the ICommandHandlerAsync type without specifying the T type

I will immediately highlight the question, below will be a detailed description of what I need it for. In Autofac, dependenc ... AsEnumerable()); return handlersDict; }) }).InstancePerLifetimeScope();

Converting String to Int

Why is this code string a = "45"; Console.WriteLine(Convert.ToInt32(a)); Outputs "45" and such string a = "45"; Console.WriteLine(Convert.ToInt32(a[0])); Outputs "52" and not "4"? How do I get a "4"?