Ejemplo n.º 1
0
    static void OnEntitySync(uint entityid, byte command, ref VectorArr vec)
    {
        NativeEntity entity = NativeEntityMgr.singleton.Get(entityid);

        switch (command)
        {
        case ASCII.p:
            Vector3 pos = vec.ToVector();
            pos.y = NativeScene.singleton.TerrainY(pos);
            entity.transfrom.position = pos;
            break;

        case ASCII.s:
            entity.transfrom.localScale = vec.ToVector();
            break;

        case ASCII.r:
            entity.transfrom.rotation = Quaternion.Euler(vec.ToVector());
            break;

        case ASCII.f:
            entity.transfrom.forward = vec.ToVector();
            break;

        default:
            XDebug.LogError("not regist command ", command);
            break;
        }
    }
Ejemplo n.º 2
0
    public void MoveForward(Vector3 forward)
    {
        VectorArr va = new VectorArr(forward);

        NativeInterface.iEntityMoveForward(UID, ref va);
        if (anim != null)
        {
            anim.SetTrigger(AnimTriger.ToMove);
        }
    }
Ejemplo n.º 3
0
 public static extern void iGoInfo(string name, byte command, ref VectorArr vec);
Ejemplo n.º 4
0
 public static extern void iEntityMoveForward(uint entityid, ref VectorArr vec);