Skip to content

Commit

Permalink
Merge pull request #91 from SideQuestVR/dev
Browse files Browse the repository at this point in the history
merge dev to test ci
  • Loading branch information
mikeskydev authored Jan 7, 2025
2 parents 7783853 + ef90256 commit 49671ca
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 20 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,36 @@ jobs:
TAG=$(jq -r '.version' package.json)
echo "TAG=$TAG" >> $GITHUB_ENV
if git rev-parse $TAG >/dev/null 2>&1; then
echo "TAG_EXISTS=true" >> $GITHUB_ENV
echo "::error::Tag already exists: $TAG"
exit 1
else
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
- name: Samples to Samples~
- name: Publish on UPM branch
run: |
if [[ -d "Samples" ]]; then
git mv Samples Samples~
rm -f Samples.meta
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "fix: Samples => Samples~"
git push -u origin main
fi
mkdir ../upm
cp -r . ../upm
rm -rf ../upm/.git # don't want to replace git history!
git reset --hard HEAD
git checkout upm
cp -r ../upm/* .
rm -rf ../upm
git config --global user.name 'github-bot'
git config --global user.email '[email protected]'
git commit -am "$TAG" --no-verify
git push -u origin upm
- name: Create Release
if: env.TAG_EXISTS == 'false'
run: |
git tag ${{ env.TAG }} main
git tag ${{ env.TAG }} upm
git push origin --tags
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ public IEnumerator Coroutine()
{
var yieldAfter = YieldAfterTasks;
sw.Start();
for (int i = 0; i < yieldAfter && !tasks.IsEmpty
&& sw.Elapsed < YieldAfterTime; i++)
for (int i = 0; i < tasks.Count; i++)
{
QueueItem task;
do if (!tasks.TryDequeue(out task)) goto exit; // try dequeue, if we can't exit
Expand Down
39 changes: 30 additions & 9 deletions Runtime/Scripts/Scene/BanterScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,22 @@ public void SetJsObjectActive(string msg, int reqId)
Debug.LogError("[Banter] SetJsObjectActive message is malformed: " + msg);
return;
}
var banterObject = GetGameObject(int.Parse(msgParts[0]));
if (banterObject != null)
try
{
UnityMainThreadTaskScheduler.Default.Enqueue(() =>
{
banterObject.SetActive(int.Parse(msgParts[1]) == 1);
SendObjectUpdate(banterObject, reqId);
});
var banterObject = GetGameObject(int.Parse(msgParts[0]));
if (banterObject != null)
{
UnityMainThreadTaskScheduler.Default.Enqueue(() =>
{
banterObject.SetActive(int.Parse(msgParts[1]) == 1);
SendObjectUpdate(banterObject, reqId);
});
}
}
catch (Exception ex)
{
Debug.LogError("SetJsObjectActive threw an exception: " + msg);
Debug.LogException(ex);
}
}
public void SetJsObjectLayer(string msg, int reqId)
Expand Down Expand Up @@ -1050,6 +1058,10 @@ private List<object> SetComponentProperties(int startIndex, string[] parts, Bant
banterComp.UpdateProperty(name, valFloat);
break;
case PropertyType.Int:
if (propParts[2].Equals("null"))
{
propParts[2] = "0";
}
var valInt = int.Parse(propParts[2]);
updates.Add(new BanterInt() { n = name, x = valInt });
banterComp.UpdateProperty(name, valInt);
Expand Down Expand Up @@ -1081,7 +1093,7 @@ private List<object> SetComponentProperties(int startIndex, string[] parts, Bant
}
catch (Exception e)
{
Debug.LogError("[Banter] Error setting property: " + e.Message + ": " + msg);
Debug.LogError("[Banter] Error setting property: " + name + " " + type + " " + e.Message + ": " + msg);
}
}
return updates;
Expand Down Expand Up @@ -1328,10 +1340,15 @@ public async Task LoadUrl(string url, bool isLoadingOpen = false)
{
return;
}
_ = ShowSpaceImage(url);
LogLine.Do("[BanterScene] Loading ShowSpaceImage: " + url);
await ShowSpaceImage(url);
LogLine.Do("[BanterScene] Loading ResetScene: " + url);
await ResetScene();
LogLine.Do("[BanterScene] Loading LoadUrl: " + url);
await link.LoadUrl(url);
LogLine.Do("[BanterScene] Loading WaitUntil: " + url);
await new WaitUntil(() => loaded);
LogLine.Do("[BanterScene] Loading after WaitUntil: " + url);
LoadingStatus = "Please wait, loading live space...";
if (HasLoadFailed())
{
Expand All @@ -1343,7 +1360,11 @@ public async Task LoadUrl(string url, bool isLoadingOpen = false)
{
events.OnUnitySceneLoad.Invoke(url);
});
LogLine.Do("[BanterScene] Loading Task.Delay(2500): " + url);

await Task.Delay(2500);
LogLine.Do("[BanterScene] Loading loadingManager?.LoadOut: " + url);

await loadingManager?.LoadOut();
loading = false;
});
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Scripts/Scene/Components/BanterMaterial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task SetTexture(string texture)
{
try
{
if (!scene.settings.EnableDefaultTextures && string.IsNullOrEmpty(texture))
if ((!scene.settings.EnableDefaultTextures && string.IsNullOrEmpty(texture)) || !Uri.IsWellFormedUriString(texture, UriKind.Absolute))
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.sidequest.banter",
"version": "2.5.1",
"version": "2.5.2",
"displayName": "Banter SDK",
"description": "This Module contains the Banter SDK used for building spaces in the bantaverse.",
"unity": "2022.3",
Expand Down

0 comments on commit 49671ca

Please sign in to comment.