@KasperMUller

Проблема с кодом в Unity Ecs, как исправить?

в общем , решил сделать контроллер персонажа через unity ecs. И тут вот такая ошибка , пробовал многое ничего не помогло.
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;

public struct CharacterControllerComponent : IComponentData
{
public float3 CurrentDirection;
public float3 CurrentMagnitude;
public bool Jump;
public float3 Gravity;
public float MaxSpeed;
public float Speed;
public float JumpStrength;
public float MaxStep;
public float Drag;
public bool IsGrounded;
public float3 JumpVelocity;
}

[DisallowMultipleComponent]
public sealed class CharacterControllerComponentView : MonoBehaviour, IConvertGameObjectToEntity
{
public float3 Gravity = new float3(0.0f, -9.81f, 0.0f);
public float MaxSpeed = 7.5f;
public float Speed = 5.0f;
public float JumpStrength = 0.15f;
public float MaxStep = 0.35f;
public float Drag = 0.2f;

public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
if (!enabled)
{
return;
}

dstManager.AddComponentData(entity, new CharacterControllerComponent
{
Gravity = Gravity,
MaxSpeed = MaxSpeed,
Speed = Speed,
JumpStrength = JumpStrength,
MaxStep = MaxStep,
Drag = Drag,
CurrentDirection = float3.zero,
CurrentMagnitude = float3.zero,
Jump = false,
IsGrounded = false,
JumpVelocity = float3.zero
});
}
}


собственно жалуется на IConvertGameObjectToEntity и GameObjectConversionSystem
6680879a6155e914268031.png
  • Вопрос задан
  • 33 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы