// z is vertical axis (3d; y for 2d), x is horizontal axis
rigidBody.velocity = transform.forward * z + transform.right * x;
public namespace MyNamespace {
public class MyClass {
//code
}
}
using MyNamespace;
private void Update() {
if (Input.GetKeyDown(KeyCode.Escape)) {
// your code
}
}
private void Update() {
if (Input.GetKeyDown(KeyCode.Escape))
OnPauseStart();
}
public void OnPauseStart() {
// your code
}
private void Update() {
if (Application.platform == RuntimePlatform.Android) {
if (Input.GetKeyDown(KeyCode.Escape)) {
// your code
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>discord-application</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/net.dv8tion/JDA -->
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<!-- MainClass in mainfest make a executable jar -->
<archive>
<manifest>
<mainClass>study.DiscordBot</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
if (x != 0)
transform.eulerAngles = new Vector3(transform.eulerAngles.x, x > 0 ? 0 : 180, transform.eulerAngles.z);
// если оси X/Z без вращения, то можно так:
if (x != 0)
transform.eulerAngles = new Vector3(0, x > 0 ? 0 : 180, 0);
Object r = 13.1;
if (r instanceof Double) {
System.out.println("matches double");
}
String example = "1331.2";
if (Pattern.matches("^[\\+\\-]{0,1}[0-9]+[\\.\\,][0-9]+$", (CharSequence) example)) {
System.out.println("matches double");
}