i am trying to mimic sample provided in github. but i can’t reference IConvertGameObjectToEntity
below is code i try to write
using unity 2018.3.14f1
with unity entities 0.0.12 - preview.24
using System;
using Unity.Entities;
using UnityEngine;
public class PlayerAxisInput : MonoBehaviour, IConvertGameObjectToEntity
{ }
class PlayerAxisInputSystem : ComponentSystem
{
struct ReqComponent
{
public PlayerAxisInput axis;
}
protected override void OnUpdate()
{
var input = new Vector2(Input.GetAxis("Horizontal"), 0);
foreach (var e in GetEntities<ReqComponent>())
{
// e.axis.InputVector = input;
}
}
}
the convert haven’t written yet. since i can’t even reference interface i want
The conversion pipeline was introduced after the 0.0.12-preview.24 and require Unity 2019.1 or newer. Also GetEntities was discontinued and removed in newer versions of the entities package.
Unless you are trying to use DOTS on a project with frozen 2018.3 version, you should take a look in the sample
So i just downloaded 2019.1.13f1 from unity hub and trying to just hotplug my mostly 2018 empty project. it doesnt seems to fetch up iconvertgameobjecttoentity even though i have already removed and re installed it. including removing and adding reference for assembly definition
What the version after updating the Entities package? Should be preview-0.1.1.
You should also install the Hybrid Render package otherwise you will need your own DOTS render system.
it is preview-0.1.1.
also installed hybrid render package. but still i can’t seem to reference it.
Edit :
so i found out that removing folder .asmdef, solved my issue. which mean i havent referenced unity entities properly, asmdef. is there any other asmdef i needed to reference in order to use IConvertGameObjectToEntity ?
IConvertGameObjectToEntity is in Unity.Entities.Hybrid
Tip: Even if you don’t have the correct package referenced and while you can’t add the reference via the IDE (Unity will still throw an error and as soon as project is recreated it’ll be removed) it is often smart enough to know what to reference
Then you can just manually add it to the asmdef. This makes it pretty easy to find what you need to add.
Unfortunately that’s the difference between a code editor and an integrated development environment
I assume you’re on MacOS if you’re using VSCode.
I highly recommend Rider for Unity development these days as it just has a lot more support (though I haven’t tried MacOS version but I’d assume it’s the same). If you happen to be a student it’s also free.
Very confusing that it’s in Unity.Entities.Hybrid asmdef but namespace is Unity.Entities. Wouldn’t have to google it if it was split. Similar issue with Unity.Collections and NativeStrings.