Дополнен 3 месяца назад
2 cкрипт: using UnityEngine;
using UnityEngine.SceneManagement;
public class Player : MonoBehaviour
{
[SerializeField] KeyCode KeyOne;
[SerializeField] KeyCode KeyTwo;
[SerializeField] Vector3 moveDirection;
private void FixedUpdate()
{
if(Input.GetKey(KeyOne))
{
GetComponent<Rigidbody>().linearVelocity += moveDirection;
}
if(Input.GetKey(KeyTwo))
{
GetComponent<Rigidbody>().linearVelocity -= moveDirection;
}
if(Input.GetKey(KeyCode.R))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
SwipeDetector.SwipeEvent += OnSwipe;
}
private void OnSwipe(Vector2 Direction)
{
Vector3 dir = Direction == Vector2.up ? Vector3.forward :
Direction == Vector2.down ? Vector3.back : (Vector3)Direction;
Move(dir);
}
private void OnTriggerEnter(Collider other)
{
if(this.CompareTag("Player") && other.CompareTag("Finish"))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
}
Дополнен 3 месяца назад
2 ошибка:
Failed to find entry-points:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Exception: Failed to resolve assembly 'Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in directories: C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\MonoBleedingEdge\lib\mono\unityjit-win32
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\MonoBleedingEdge\lib\mono\unityjit-win32\Facades
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.visualscripting\Editor\VisualScripting.Core\Dependencies\DotNetZip
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.collab-proxy\Lib\Editor
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\Managed
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.visualscripting\Editor\VisualScripting.Core\EditorAssetResources
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.ide.rider\Rider\Editor
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.nuget.newtonsoft-json\Runtime
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.burst
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.burst\Unity.Burst.CodeGen
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\PlaybackEngines\WebGLSupport
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.ext.nunit\net40\unity-custom
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.nuget.mono-cecil
Дополнен 3 месяца назад
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.visualscripting\Editor\VisualScripting.Core\Dependencies\YamlDotNet
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.nuget.newtonsoft-json\Runtime\AOT
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.collections\Unity.Collections.LowLevel.ILSupport
D:\юнити проекты\3D Casual Puzzle Game\Library\PackageCache\com.unity.visualscripting\Runtime\VisualScripting.Flow\Dependencies\NCalc
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\Managed\UnityEngine
C:\Program Files\Unity\Hub\Editor\6000.0.25f1\Editor\Data\PlaybackEngines\WebGLSupport\Managed
D:\юнити проекты\3D Casual Puzzle Game\Library\ScriptAssemblies ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00105] in <853812ae52c341daaef3c62ecdb86b32>:0
at zzzUnity.Burst.CodeGen.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00007] in <69b504cf34c54d688310e60f1ce29d2e>:0
--- End of inner exception stack trace ---
at zzzUnity.Burst.CodeGen.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name) [0x00054] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.AssemblyLoader.Resolve (Mono.Cecil.AssemblyNameReference name) [0x0007e] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.EntryPointMethodFinder.FindEntryPoints (System.String[] rootAssemblyNames,
Дополнен 3 месяца назад
Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, Burst.Compiler.IL.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, Burst.Compiler.IL.Server.ProfileDelegate profileCallback, System.Boolean includeRootAssemblyReferences, System.Boolean splitTargets) [0x00055] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer+<>c__DisplayClass18_1.<FindMethods>b__0 (Burst.Compiler.IL.Server.Caching.CacheManager cacheManager) [0x0005e] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer+<>c__DisplayClass26_0`1[TResult].<RunTask>b__0 () [0x00145] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer.RunTask[TResult] (Burst.Compiler.IL.Server.TargetKey target, System.String taskName, System.String[] assemblyFolders, System.Threading.CancellationToken cancellationToken, System.Func`2[T,TResult] function) [0x00131] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer.FindMethods (Burst.Compiler.IL.Server.CompilerServerOptions options, Burst.Compiler.IL.Aot.AotCompilerOptions aotOptions, Burst.Compiler.IL.AssemblyDefinesDict assemblyDefines, Burst.Compiler.IL.Server.TargetKey target, Burst.Compiler.IL.Server.Caching.CacheManager cacheManager, Burst.Compiler.IL.CompilerStatistics stats, System.Threading.CancellationToken cancellationToken) [0x00299] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer+<>c__DisplayClass26_0`1[TResult].<RunTask>b__0 () [0x00145] in <69b504cf34c54d688310e60f1ce29d2e>:0
Дополнен 3 месяца назад
at Burst.Compiler.IL.Server.CompilerServer.RunTask[TResult] (Burst.Compiler.IL.Server.TargetKey target, System.String taskName, System.String[] assemblyFolders, System.Threading.CancellationToken cancellationToken, System.Func`2[T,TResult] function) [0x00131] in <69b504cf34c54d688310e60f1ce29d2e>:0
at Burst.Compiler.IL.Server.CompilerServer.Compile (Burst.Compiler.IL.Server.CompilerServerOptions options, Burst.Compiler.IL.Server.CompilationMessageStreamer streamer, System.Threading.CancellationToken cancellationToken) [0x001ca] in <69b504cf34c54d688310e60f1ce29d2e>:0
While compiling job:
Дополнен 3 месяца назад
1 ошибка:
Assets\TutorialInfo\Scripts\SwipeDetector.cs(46,31): error CS1002: ; expected
2, 3, 4 и 5 ошибки абсолютно одинаковые
using UnityEngine;
public class SwipeDetector : MonoBehaviour
{
public static event OnSwipeInput SwipeEvent;
public delegate void OnSwipeInput(Vector2 Direction);
private Vector2 tapPosition;
private Vector2 swipeDelta;
private float deadZone = 80;
private bool isSwiping;
private bool isMobile;
void start()
{
isMobile = application.isMobilePlatform;
}
void update()
{
if(!isMobile)
{
if (input.GetMouseButtonDown(0))
{
isSwiping = True;
tapPosition = input.mousePosition;
}
else if (input.GetMouseButtonUp(0))
ResetSwipe();
}
else
{
if (input.touchCount > 0)
{
if (input.GetTouch(0).phase == TouchPhase.Began)
{
isSwiping = True;
tapPosition = input.GetTouch(0).position;
}
else if (input.GetTouch(0).phase == TouchPhase.Canceled||
input.GetTouch(0).phase == TouchPhase.Ended)
{
ResetSwipe
}
}
}
ChekSwipe();
}
private void ChekSwipe()
{
swipeDelta = Vector2.zero ;
if (isSwiping)
{
if (!isMobile && input.GetMouseButton(0))
swipeDelta = (Vector2)input.mousePosition - tapPosition;
else if (input.touchCount > 0)
swipeDelta = input.GetTouch(0).position - tapPosition;
}
if (swipeDelta.magnitude > deadZone)
{
if (SwipeEvent != null)
{
if (mathf.Abs(swipeDelta.x) > mathf.Abs(swipeDelta.y))
SwipeEvent(swipeDelta.x > 0 ? Vector2.Right : Vector2.left);
else
SwipeEvent (swipeDelta.y > 0 ? Vector2.up : Vector2.down);
}
ResetSwipe();
}
}
private void ResetSwipe()
{
isSwiping = false;
tapPosition = Vector2.zero ;
swipeDelta = Vector2.zero ;
}
}
остальное добавлю в дополнении, помогите пожалуйста исправить их