Skip to content

Commit

Permalink
Merge branch 'release/v1.1.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonHough committed Mar 21, 2023
2 parents 4bccdb4 + d25db7c commit b821698
Show file tree
Hide file tree
Showing 30 changed files with 574 additions and 334 deletions.
13 changes: 5 additions & 8 deletions .github/latest.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
This update fixes a number of bugs and adds support for optional SDK logging.
This update includes an additional popup for the new Quick Start sample, operation completed event and README updates.

## Changelog

### Added
- optional sdk logging
- don't ask again option for update check
- quick start sample popup
- added operation completed event
- discussion link to README.md

### Updated
- PartnerSubdomainSettings refactored to a CoreSettings scriptable object

### Fixed
- core settings asset now automatically created if it is missing.
- Various bug fixes and improvements
- OpenUPM installation added to README.md
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.1.0] - 2023.03.21

### Added
- quick start sample popup
- added operation completed event
- discussion link to README.md

### Updated
- OpenUPM installation added to README.md

## [1.0.0] - 2023.02.20

### Added
- optional sdk logging
- don't ask again option for update check

### Updated
- PartnerSubdomainSettings refactored to a CoreSettings scriptable object

### Fixed
- core settings asset now automatically created if it is missing
- Various bug fixes and improvements

## [0.2.0] - 2023.02.08

### Added
Expand Down
8 changes: 0 additions & 8 deletions Configurations.meta

This file was deleted.

22 changes: 0 additions & 22 deletions Configurations/Avatar Config High.asset

This file was deleted.

8 changes: 0 additions & 8 deletions Configurations/Avatar Config High.asset.meta

This file was deleted.

22 changes: 0 additions & 22 deletions Configurations/Avatar Config Low.asset

This file was deleted.

8 changes: 0 additions & 8 deletions Configurations/Avatar Config Low.asset.meta

This file was deleted.

22 changes: 0 additions & 22 deletions Configurations/Avatar Config Medium.asset

This file was deleted.

8 changes: 0 additions & 8 deletions Configurations/Avatar Config Medium.asset.meta

This file was deleted.

17 changes: 16 additions & 1 deletion Editor/Analytics/AnalyticsEventLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public void LogUpdatePartnerURL(string previousSubdomain, string newSubdomain)
});
}


public void LogOpenDialog(string dialog)
{
if (!isEnabled) return;
Expand All @@ -130,6 +129,22 @@ public void LogBuildApplication(string target, string appName, bool productionBu
});
}

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

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

private void GenerateSessionId()
{
amplitudeEventLogger.SetSessionId(DateTimeOffset.Now.ToUnixTimeMilliseconds());
Expand Down
3 changes: 3 additions & 0 deletions Editor/Analytics/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public static class EventName
public const string OPEN_DIALOG = "open dialog";
public const string BUILD_APPLICATION = "build application";
public const string CLOSE_PROJECT = "close project";
public const string METADATA_DOWNLOADED = "metadata downloaded";
public const string AVATAR_LOADED = "avatar loaded";
public const string SET_USER_PROPERTIES = "set user properties";
}

Expand All @@ -35,6 +37,7 @@ public static class Properties
public const string AVATAR_URL = "avatar url";
public const string APP_IDENTIFIER = "app identifier";
public const string ALLOW_ANALYTICS = "allow analytics";
public const string DURATION = "duration";
}

public static class AmplitudeKeys
Expand Down
3 changes: 3 additions & 0 deletions Editor/Analytics/IAnalyticsEventLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ public interface IAnalyticsEventLogger
void LogUpdatePartnerURL(string previousSubdomain, string newSubdomain);
void LogOpenDialog(string dialog);
void LogBuildApplication(string target, string appName, bool productionBuild);
void LogMetadataDownloaded(double duration);
void LogAvatarLoaded(double duration);

}
}
8 changes: 4 additions & 4 deletions Editor/Module Management/ModuleList.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.PackageManager;

Expand All @@ -14,7 +14,7 @@ public static class ModuleList
name = "com.readyplayerme.core",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-core.git",
branch = "",
version = "1.0.0"
version = "1.1.0"
};

/// <summary>
Expand All @@ -34,14 +34,14 @@ public static class ModuleList
name = "com.readyplayerme.avatarloader",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-avatar-loader.git",
branch = "",
version = "1.0.0"
version = "1.1.0"
},
new ModuleInfo
{
name = "com.readyplayerme.webview",
gitUrl = "https://github.com/readyplayerme/rpm-unity-sdk-webview.git",
branch = "",
version = "1.0.0"
version = "1.1.0"
}
};

Expand Down
136 changes: 136 additions & 0 deletions Editor/UI/Components/AnalyticsPanel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
using ReadyPlayerMe.Core.Analytics;
using UnityEditor;
using UnityEngine;
using UnityEngine.Events;


namespace ReadyPlayerMe.Core.Editor
{
public class AnalyticsPanel : IEditorWindowComponent
{
private const string HEADING = "Help us improve Ready Player Me SDK";
private const string DESCRIPTION =
"We are constantly adding new features and improvements to our SDK. Enable analytics and help us in building even better free tools for more developers. This data is used for internal purposes only and is not shared with third parties.";
private const string ANALYTICS_PRIVACY_TEXT = "Read our Privacy Policy and learn how we use the data <b>here</b>.";
private const string ANALYTICS_PRIVACY_URL =
"https://docs.readyplayer.me/ready-player-me/integration-guides/unity/help-us-improve-the-unity-sdk";

private const string NEVER_ASK_AGAIN = "Never Ask Again";
private const string DONT_ENABLE_ANALYTICS = "Don't Enable Analytics";
private const string ENABLE_ANALYTICS = "Enable Analytics";
private const int BUTTON_FONT_SIZE = 12;

private static bool neverAskAgain;

private readonly GUILayoutOption toggleWidth = GUILayout.Width(20);
private GUIStyle buttonStyle;

private bool variablesLoaded;

private GUIStyle descriptionStyle;
private GUIStyle HeadingStyle;
public string EditorWindowName { get; set; }

public UnityEvent OnButtonClick = new UnityEvent();

public AnalyticsPanel(string editorWindowName)
{
EditorWindowName = editorWindowName;
}

/// <summary>
///
/// </summary>
private void LoadCachedVariables()
{
neverAskAgain = ProjectPrefs.GetBool(WelcomeWindow.NeverAskAgainPref);
variablesLoaded = true;
}

/// <summary>
/// Sets the <c>EditorWindow</c> styles.
/// </summary>
private void LoadStyles()
{
HeadingStyle ??= new GUIStyle
{
fontSize = 14,
richText = true,
fontStyle = FontStyle.Bold,
margin = new RectOffset(5, 0, 0, 8),
normal =
{
textColor = Color.white
}
};

descriptionStyle ??= new GUIStyle(GUI.skin.label)
{
fontSize = 12,
richText = true,
wordWrap = true,
fixedWidth = 450,
normal =
{
textColor = new Color(0.7f, 0.7f, 0.7f, 1.0f)
}
};

buttonStyle ??= new GUIStyle(GUI.skin.button)
{
fontStyle = FontStyle.Bold,
fontSize = BUTTON_FONT_SIZE,
padding = new RectOffset(5, 5, 5, 5),
fixedHeight = 30,
fixedWidth = 225
};
}


public void Draw(Rect position = new Rect())
{
if (!variablesLoaded) LoadCachedVariables();
LoadStyles();
EditorGUILayout.BeginVertical("Box");
GUILayout.Label(HEADING, HeadingStyle);

GUILayout.Space(10);
GUILayout.Label(DESCRIPTION, descriptionStyle);

GUILayout.Space(10);
if (GUILayout.Button(ANALYTICS_PRIVACY_TEXT, descriptionStyle))
{
Application.OpenURL(ANALYTICS_PRIVACY_URL);
}

EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);

GUILayout.Space(10);
EditorGUILayout.BeginHorizontal();
GUILayout.Space(4);
neverAskAgain = EditorGUILayout.Toggle(neverAskAgain, toggleWidth);
GUILayout.Label(NEVER_ASK_AGAIN);
GUILayout.FlexibleSpace();

ProjectPrefs.SetBool(WelcomeWindow.NeverAskAgainPref, neverAskAgain);
EditorGUILayout.EndHorizontal();

GUILayout.Space(10);
EditorGUILayout.EndVertical();

EditorGUILayout.BeginHorizontal();
GUILayout.Space(3);
if (GUILayout.Button(DONT_ENABLE_ANALYTICS, buttonStyle))
{
AnalyticsEditorLogger.Disable();
OnButtonClick?.Invoke();
}
if (GUILayout.Button(ENABLE_ANALYTICS, buttonStyle))
{
AnalyticsEditorLogger.Enable();
OnButtonClick?.Invoke();
}
EditorGUILayout.EndHorizontal();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b821698

Please sign in to comment.