Skip to content

Commit

Permalink
Merge branch 'release/v4.1.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Dec 5, 2023
2 parents 8f02c60 + a656f4e commit a81e76f
Show file tree
Hide file tree
Showing 49 changed files with 1,667 additions and 1,288 deletions.
8 changes: 6 additions & 2 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

## Changelog

### Updates
- fixed an issue causing avatars to be stored locally even if caching was disabled by @harrisonhough in [#150](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/150)
### Updated
- replaced API URLs with model URLs for shortcodes by @rk132 in [#152](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/152)
- updated render api and samples @rYuuk in [#147](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/147)

### Added
- Added app id to setup guide by @ryuuk in [#145](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/145)
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.1.0] - 2023.11.29

### Updated
- replaced API URLs with model URLs for shortcodes by @rk132 in [#152](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/152)
- updated render api and samples @rYuuk in [#147](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/147)

### Added
- Added app id to setup guide by @ryuuk in [#145](https://github.com/readyplayerme/rpm-unity-sdk-core/pull/145)

## [4.0.1] - 2023.11.14

### Fixed
Expand Down
142 changes: 77 additions & 65 deletions Editor/Analytics/AmplitudeEditorLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using ReadyPlayerMe.Core.Editor;
using UnityEditor;
using UnityEngine;
using static ReadyPlayerMe.Core.Analytics.Constants;

namespace ReadyPlayerMe.Core.Analytics
{
Expand Down Expand Up @@ -59,190 +60,200 @@ public void LogOpenProject()
{
if (!isEnabled) return;
GenerateSessionId();
AmplitudeEventLogger.LogEvent(Constants.EventName.OPEN_PROJECT);
AmplitudeEventLogger.LogEvent(EventName.OPEN_PROJECT);
}

public void LogCloseProject()
{
LogEvent(Constants.EventName.CLOSE_PROJECT);
LogEvent(EventName.CLOSE_PROJECT);
}

public void LogOpenDocumentation(string target)
{
LogEvent(Constants.EventName.OPEN_DOCUMENTATION, new Dictionary<string, object>
LogEvent(EventName.OPEN_DOCUMENTATION, new Dictionary<string, object>
{
{ Constants.Properties.TARGET, target }
{ Properties.TARGET, target }
});
}

public void LogOpenFaq(string target)
{
LogEvent(Constants.EventName.OPEN_FAQ, new Dictionary<string, object>
LogEvent(EventName.OPEN_FAQ, new Dictionary<string, object>
{
{ Constants.Properties.TARGET, target }
{ Properties.TARGET, target }
});
}

public void LogOpenDiscord(string target)
{
LogEvent(Constants.EventName.OPEN_DISCORD, new Dictionary<string, object>
LogEvent(EventName.OPEN_DISCORD, new Dictionary<string, object>
{
{ Constants.Properties.TARGET, target }
{ Properties.TARGET, target }
});
}

public void LogLoadAvatarFromDialog(string avatarUrl, bool eyeAnimation, bool voiceHandler)
{
LogEvent(Constants.EventName.LOAD_AVATAR_FROM_DIALOG, new Dictionary<string, object>
LogEvent(EventName.LOAD_AVATAR_FROM_DIALOG, new Dictionary<string, object>
{
{ Constants.Properties.AVATAR_URL, avatarUrl },
{ Constants.Properties.EYE_ANIMATION, eyeAnimation },
{ Constants.Properties.VOICE_HANDLER, voiceHandler }
{ Properties.AVATAR_URL, avatarUrl },
{ Properties.EYE_ANIMATION, eyeAnimation },
{ Properties.VOICE_HANDLER, voiceHandler }
});
}

public void LogUpdatePartnerURL(string previousSubdomain, string newSubdomain)
{
LogEvent(Constants.EventName.UPDATED_PARTNER_URL, new Dictionary<string, object>
LogEvent(EventName.UPDATED_PARTNER_URL, new Dictionary<string, object>
{
{ Constants.Properties.PREVIOUS_SUBDOMAIN, previousSubdomain },
{ Constants.Properties.NEW_SUBDOMAIN, newSubdomain }
{ Properties.PREVIOUS_SUBDOMAIN, previousSubdomain },
{ Properties.NEW_SUBDOMAIN, newSubdomain }
}, new Dictionary<string, object>
{
{ Constants.Properties.SUBDOMAIN, newSubdomain }
{ Properties.SUBDOMAIN, newSubdomain }
});
}

public void LogOpenDialog(string dialog)
{
LogEvent(Constants.EventName.OPEN_DIALOG, new Dictionary<string, object>
LogEvent(EventName.OPEN_DIALOG, new Dictionary<string, object>
{
{ Constants.Properties.DIALOG, dialog }
{ Properties.DIALOG, dialog }
});
}

public void LogBuildApplication(string target, string appName, bool productionBuild)
{
LogEvent(Constants.EventName.BUILD_APPLICATION, new Dictionary<string, object>
LogEvent(EventName.BUILD_APPLICATION, new Dictionary<string, object>
{
{ Constants.Properties.TARGET, target },
{ Constants.Properties.APP_NAME, appName },
{ Constants.Properties.PRODUCTION_BUILD, productionBuild },
{ Constants.Properties.APP_IDENTIFIER, Application.identifier }
{ Properties.TARGET, target },
{ Properties.APP_NAME, appName },
{ Properties.PRODUCTION_BUILD, productionBuild },
{ Properties.APP_IDENTIFIER, Application.identifier }
});
}

public void LogMetadataDownloaded(double duration)
{
LogEvent(Constants.EventName.METADATA_DOWNLOADED, new Dictionary<string, object>
LogEvent(EventName.METADATA_DOWNLOADED, new Dictionary<string, object>
{
{ Constants.Properties.DURATION, duration }
{ Properties.DURATION, duration }
});
}

public void LogAvatarLoaded(double duration)
{
LogEvent(Constants.EventName.AVATAR_LOADED, new Dictionary<string, object>
LogEvent(EventName.AVATAR_LOADED, new Dictionary<string, object>
{
{ Constants.Properties.DURATION, duration }
{ Properties.DURATION, duration }
});
}

public void LogCheckForUpdates()
{
LogEvent(Constants.EventName.CHECK_FOR_UPDATES);
LogEvent(EventName.CHECK_FOR_UPDATES);
}

public void LogSetLoggingEnabled(bool isLoggingEnabled)
{
LogEvent(Constants.EventName.SET_LOGGING_ENABLED, new Dictionary<string, object>
LogEvent(EventName.SET_LOGGING_ENABLED, new Dictionary<string, object>
{
{ Constants.Properties.LOGGING_ENABLED, isLoggingEnabled }
{ Properties.LOGGING_ENABLED, isLoggingEnabled }
});
}

public void LogSetCachingEnabled(bool isCachingEnabled)
{
LogEvent(Constants.EventName.SET_CACHING_ENABLED, new Dictionary<string, object>
LogEvent(EventName.SET_CACHING_ENABLED, new Dictionary<string, object>
{
{ Constants.Properties.CACHING_ENABLED, isCachingEnabled }
{ Properties.CACHING_ENABLED, isCachingEnabled }
});
}

public void LogClearLocalCache()
{
LogEvent(Constants.EventName.CLEAR_LOCAL_CACHE);
LogEvent(EventName.CLEAR_LOCAL_CACHE);
}

public void LogViewPrivacyPolicy()
{
LogEvent(Constants.EventName.PRIVACY_POLICY);
LogEvent(EventName.PRIVACY_POLICY);
}

public void LogShowInExplorer()
{
LogEvent(Constants.EventName.SHOW_IN_EXPLORER);
LogEvent(EventName.SHOW_IN_EXPLORER);
}

public void LogFindOutMore(HelpSubject subject)
{
LogEvent(Constants.EventName.FIND_OUT_MORE, new Dictionary<string, object>
LogEvent(EventName.FIND_OUT_MORE, new Dictionary<string, object>
{
{ Constants.Properties.CONTEXT, helpDataMap[subject] }
{ Properties.CONTEXT, helpDataMap[subject] }
});
}

public void LogOpenSetupGuide()
{
LogEvent(Constants.EventName.OPEN_SETUP_GUIDE);
LogEvent(EventName.OPEN_SETUP_GUIDE);
}

public void LogOpenIntegrationGuide()
{
LogEvent(Constants.EventName.OPEN_INTEGRATION_GUIDE);
LogEvent(EventName.OPEN_INTEGRATION_GUIDE);
}

public void LogLoadQuickStartScene()
{
LogEvent(Constants.EventName.LOAD_QUICK_START_SCENE);
LogEvent(EventName.LOAD_QUICK_START_SCENE);
}

public void LogOpenAvatarDocumentation()
{
LogEvent(Constants.EventName.OPEN_AVATAR_DOCUMENTATION);
LogEvent(EventName.OPEN_AVATAR_DOCUMENTATION);
}

public void LogOpenAnimationDocumentation()
{
LogEvent(Constants.EventName.OPEN_ANIMATION_DOCUMENTATION);
LogEvent(EventName.OPEN_ANIMATION_DOCUMENTATION);
}

public void LogOpenAvatarCreatorDocumentation()
{
LogEvent(Constants.EventName.OPEN_AVATAR_CREATOR_DOCUMENTATION);
LogEvent(EventName.OPEN_AVATAR_CREATOR_DOCUMENTATION);
}

public void LogOpenOptimizationDocumentation()
{
LogEvent(Constants.EventName.OPEN_OPTIMIZATION_DOCUMENTATION);
LogEvent(EventName.OPEN_OPTIMIZATION_DOCUMENTATION);
}

public void LogAvatarCreatorSampleImported()
{
LogEvent(Constants.EventName.AVATAR_CREATOR_SAMPLE_IMPORTED);
LogEvent(EventName.AVATAR_CREATOR_SAMPLE_IMPORTED);
}


public void LogPackageInstalled(string id, string name)
{
LogEvent(EventName.INSTALL_PACKAGE, new Dictionary<string, object>
{
{ "id", id },
{ "name", name },
});
}

private void SetUserProperties()
{
var userProperties = new Dictionary<string, object>
{
{ Constants.Properties.ENGINE_VERSION, appData.UnityVersion },
{ Constants.Properties.RENDER_PIPELINE, appData.RenderPipeline },
{ Constants.Properties.SUBDOMAIN, appData.PartnerName },
{ Constants.Properties.APP_NAME, PlayerSettings.productName },
{ Constants.Properties.SDK_TARGET, SDK_TARGET },
{ Constants.Properties.APP_IDENTIFIER, Application.identifier },
{ Constants.Properties.ALLOW_ANALYTICS, true }
{ Properties.SDK_SOURCE_URL, PackageManagerHelper.GetSdkPackageSourceUrl() },
{ Properties.ENGINE_VERSION, appData.UnityVersion },
{ Properties.RENDER_PIPELINE, appData.RenderPipeline },
{ Properties.SUBDOMAIN, appData.PartnerName },
{ Properties.APP_NAME, PlayerSettings.productName },
{ Properties.SDK_TARGET, SDK_TARGET },
{ Properties.APP_IDENTIFIER, Application.identifier },
{ Properties.ALLOW_ANALYTICS, true }
};

Dictionary<string, string> modules = ModuleList.GetInstalledModuleVersionDictionary();
Expand All @@ -252,7 +263,7 @@ private void SetUserProperties()
userProperties.Add(module.Key, module.Value);
}

LogEvent(Constants.EventName.SET_USER_PROPERTIES, null, userProperties);
LogEvent(EventName.SET_USER_PROPERTIES, null, userProperties);
}

private void GenerateSessionId()
Expand All @@ -262,24 +273,25 @@ private void GenerateSessionId()

private void ToggleAnalytics(bool allow)
{
LogEvent(Constants.EventName.ALLOW_ANALYTICS, new Dictionary<string, object>
LogEvent(EventName.ALLOW_ANALYTICS, new Dictionary<string, object>
{
{ Constants.Properties.ALLOW, allow }
{ Properties.ALLOW, allow }
}, new Dictionary<string, object>
{
{ Constants.Properties.ENGINE_VERSION, appData.UnityVersion },
{ Constants.Properties.RENDER_PIPELINE, appData.RenderPipeline },
{ Constants.Properties.SUBDOMAIN, appData.PartnerName },
{ Constants.Properties.APP_NAME, PlayerSettings.productName },
{ Constants.Properties.SDK_TARGET, "Unity" },
{ Constants.Properties.APP_IDENTIFIER, Application.identifier },
{ Constants.Properties.ALLOW_ANALYTICS, allow }
{ Properties.ENGINE_VERSION, appData.UnityVersion },
{ Properties.RENDER_PIPELINE, appData.RenderPipeline },
{ Properties.SUBDOMAIN, appData.PartnerName },
{ Properties.APP_NAME, PlayerSettings.productName },
{ Properties.SDK_TARGET, "Unity" },
{ Properties.APP_IDENTIFIER, Application.identifier },
{ Properties.ALLOW_ANALYTICS, allow }
});
}

private void LogEvent(string eventName, Dictionary<string, object> eventProperties = null, Dictionary<string, object> userProperties = null)
{
if (!isEnabled) return;

AmplitudeEventLogger.LogEvent(eventName, eventProperties, userProperties);
}
}
Expand Down
2 changes: 2 additions & 0 deletions Editor/Analytics/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ public static class EventName
public const string OPEN_AVATAR_CREATOR_DOCUMENTATION = "open avatar creator documentation";
public const string OPEN_OPTIMIZATION_DOCUMENTATION = "open optimization documentation";
public const string AVATAR_CREATOR_SAMPLE_IMPORTED = "Avatar creator sample imported";
public const string INSTALL_PACKAGE = "install unity package";
}

public static class Properties
{
public const string SDK_SOURCE_URL = "sdk source url";
public const string ENGINE_VERSION = "engine version";
public const string RENDER_PIPELINE = "render pipeline";
public const string SUBDOMAIN = "subdomain";
Expand Down
3 changes: 3 additions & 0 deletions Editor/Analytics/IAnalyticsEditorLogger.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using ReadyPlayerMe.Core.Editor;

namespace ReadyPlayerMe.Core.Analytics
{
public interface IAnalyticsEditorLogger
Expand Down Expand Up @@ -31,5 +33,6 @@ public interface IAnalyticsEditorLogger
void LogOpenAvatarCreatorDocumentation();
void LogOpenOptimizationDocumentation();
void LogAvatarCreatorSampleImported();
void LogPackageInstalled(string id, string name);
}
}
2 changes: 1 addition & 1 deletion Editor/Module Management/ModuleList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ModuleList
name = "com.readyplayerme.core",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-core.git",
branch = "",
version = "4.0.1"
version = "4.1.0"
};

/// <summary>
Expand Down
File renamed without changes.
Loading

0 comments on commit a81e76f

Please sign in to comment.