c#

Character Death from enemy Unity 2D

There is an enemy under the tag "mouse" and also a code, when the hero just touches the "mouse" in any way, it disappears (mo ... ero himself dies in a horizontal collision from the mouse, but at the same time the hero can kill him by jumping on his head.

Error in Karatsuba's algorithm for Long Arithmetic

I'm trying to make a library with long numbers. And there was a problem that I had been trying to fix for a week. The problem ... late the product in 2 ways ( that is, I will first add a1b1 and 2 method a2b2), then in any case I will get the wrong answer.

Working with Dictionary in conjunction with GameObject

For my game of the "get out of the room" type, I want to create hints that appear when you click on the button with a questio ... more Dictionaries with the name of the variable and the name of the script itself (the keyword will be the same in all cases)

Select several random values from the data array in the form of images

Please tell the novice, you need to select several random values from the data array and output them as images How do I bind ... mage = Properties.Resources.bread_0; } if (randomChamp == "water") { pictureBox2.Image = Properties.Resources.water_0;

How to declare a single class in multiple files in C#

How to declare a single class in multiple files in C#

Unity. How to make a player interaction zone with objects (2d platformer)?

I'm new to Unity, please don't throw your sneakers. The game is based on Unity, a simple 2d platformer. I want to make a tran ... but I absolutely can't think of how to implement such a construction. Please tell me, if not difficult, then in more detail.

Unity Object Spawn via coroutine

void Update() { StartCoroutine(SpawnBox(10)); } IEnumerator SpawnBox(float time) { PhotonNetw ... es it spawn a lot and not wait ? I want to make it spawn one object and wait 10 seconds, and so cyclically How do I do this ?

How do I rotate an object around its axis?/Unity3d

There is a ball that I want to rotate around its axis forward . The question itself would be very easy, if not for one but. ... } The only way out I see is to change the mechanics of movement, but how? //Rotating the animation is probably a bad idea.

Cloning the GameObject Unity class

I want to clone in a script GameObject without it appearing on the scene(so Instantiate won't do) GameObject prefab = ne ... variant = // Волшебное клонирование prefab // Тут variant и prefab совершенно идентичны, но ссылаются на разные объекты

How can I use indexOf to find all occurrences of an element in an array?

I'm implementing a program to find the first occurrence of an element in an array, but I can't figure out how to find all the ... Console.Write("The first time value on position [{0}] ", index); Console.ReadKey(); }

Random. Range () returns the same number. (unity/c#)

Why does Random.Range () return the same number? Each time it returns 0. Instantiate(Object[Random.Range(0, 1)], new Vector2(0, 0), Quaternion.identity);

Access modifiers in C#

Let's say I set the access modifier internal to the class, and the variable in this class is public. Question, will this variable have an access modifier internal (as a class access modifier) or public (as a variable access modifier)?

How do I determine the excel file format?

If you do not go into details, you come across files .xlsx which are named as .xls and vice versa, .xls that are named as .xl ... s and rename them correctly, but I did not find how to determine the file format without relying on the extension in its name

How to create a constructor in the descendant with parameters that do not match the parameters of the base constructor

There is a constructor in the base class public Kons(int a, string b){} You need to make a constructor in the heir public ... c):base(a,b){} Writes that the non-static field b requires a reference to the object. You can't make b static. What to do?

Problem with Quaternion in unity

I make a 2d shooter, the gun turns depending on the cursor, if we press the lmb, then a bullet is created, which takes the ar ... output a number that does not reach one and minus one, i.e. -0.9835, 08953, and so on. (Usually in these values). What to do?

The difference between a text-based MD5 hash sum and a file-based hash sum

There is a program whose essence is to accept an HTTP request with a file and in the response you need to send an MD5 hash am ... he amount from the file. I check it in Notepad++. Help teach the Windows service build to calculate a hash based on the text

How to implement plants in a Plant vs Zombie type game? Unity

I want to try to make a game like Plants vs Zombies. But I do not understand how best and most correctly to implement plants. ... similar. Maybe learn some new things and suddenly I got stuck on such a question. I hope for help, thank you in advance :)))

How do I save cookies from a website in a separate file and use them only in the future?

When you log in to the site, cookies are issued, and each time you run the program, this very authorization is performed. So, ... unt; i++) { write.Write(req.Cookies.Keys.ElementAt(i) + ": " + req.Cookies.Values.ElementAt(i) + Environment.NewLine); }

Reading Cyrillic from a C file#

You need to read the file in which there are Cyrillic characters, when output to the screen, all clerical characters are disp ... mFile}"); } } Is there a way to correctly return the Cyrillic alphabet after reading it in the console?

Unity can't insert an object in the object script field

I have a prefab on which the script hangs. The script has a field for the public GameObject scene; the scene itself has a Sc ... containing this script and at the same time I insert there and all prefabs I save that too result. Help a novice programmer.