Самые годные лайфхаки по unity c#
Сотрудничество/реклама/помощь @Akrus001
Post #1018
745
- ❤ 5
- 👍 3
- 🔥 1
AK @akrusunity
Showing posts older than #1019 · Back to latest
using System;
class Program
{
static bool Print()
{
Console.Write("B");
return true;
}
static void Main()
{
if (false && Print())
{
}
Console.Write("A");
}
}


using System;
class Program
{
static void Change(ref int x)
{
x = 10;
}
static void Main()
{
int a = 5;
Change(ref a);
Console.WriteLine(a);
}
}
using System;
class Program
{
static void Main()
{
object a = 5;
object b = 5;
Console.WriteLine(a == b);
}
}

using System;
class Program
{
static void Main()
{
int x = 5;
int y = x++ + ++x;
Console.WriteLine(y);
}
}
Все числа — int, float, long и т.д.
bool
Строки
Время
Кортеж — (int, string)
Списки, словари
Массивы
Множества
Классы
using System;
class Program
{
static void Main()
{
string text = "Hello";
text.Replace("H", "J");
Console.WriteLine(text);
}
}
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
List<string> names = new List<string>
{
"Ann",
"Bob",
"Kate",
"Tom"
};
Console.WriteLine(/* ??? */);
}
}
using System;
using System.Linq;
class Program
{
static void Main()
{
int[] numbers = { 1, 2, 3, 4, 5, 6 };
var result = /* ??? */;
Console.WriteLine(string.Join(", ", result));
}
}
Forwarded from MyIndie | Трушный gamedev
