frankvHoof93 / TikTokLiveSharp

Port of TikTok live library for C#
https://vanhoof.dev
Other
149 stars 31 forks source link

[QUESTION] #37

Closed YozziMatrotzi closed 11 months ago

YozziMatrotzi commented 12 months ago

I wnat to use this for my Unity Game. But there comes this Error. I installed the package in the package manager with this link: https://github.com/frankvHoof93/TikTokLiveSharp.git#TikTokLiveUnity

Assets\Scripts\TestData.cs(40,55): error CS0246: The type or namespace name 'WebcastGiftMessage' could not be found (are you missing a using directive or an assembly reference?)

Assets\Scripts\TestData.cs(31,13): error CS0246: The type or namespace name 'TikTokLiveClient' could not be found (are you missing a using directive or an assembly reference?)

I want a basic test script: this is what i used: using UnityEngine; using TikTokLiveSharp; using TikTokLiveSharp.Models;

public class TestData : MonoBehaviour { private TikTokLiveClient client;

void Start()
{
    client = new TikTokLiveClient("uniqueID");
    client.OnGiftReceived += Client_OnGiftReceived;
    client.Start();
}

private void Client_OnGiftReceived(object sender, WebcastGiftMessage e)
{
    Debug.Log($"{e.User.uniqueId} hat ein Geschenk gegeben: {e.Gift.name}");
}

}

Can someone help me?

frankvHoof93 commented 11 months ago

Please make sure you're able to access the assembly that contains the code. https://docs.unity3d.com/Manual/cus-asmdef.html

If you're still having issues, please make a new Github Issue