Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(assets): get assets path from plugin info (#20)
  • Loading branch information
Xenira committed Mar 13, 2024
1 parent 94d7e91 commit 9c0db5a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
@@ -1,6 +1,7 @@
{
"conventionalCommits.scopes": [
"release",
"tracking"
"tracking",
"avatar"
]
}
9 changes: 4 additions & 5 deletions plugin/src/TTIK.cs
Expand Up @@ -18,7 +18,7 @@ public class TTIK : BaseUnityPlugin
{
private static PluginLogger Logger;

Check warning on line 19 in plugin/src/TTIK.cs

GitHub Actions / build

'TTIK.Logger' hides inherited member 'BaseUnityPlugin.Logger'. Use the new keyword if hiding was intended.

Check warning on line 19 in plugin/src/TTIK.cs

GitHub Actions / build

'TTIK.Logger' hides inherited member 'BaseUnityPlugin.Logger'. Use the new keyword if hiding was intended.

private static AssetLoader assetLoader = new AssetLoader("TTIK/assets");
private static AssetLoader assetLoader;
public static GameObject ikPlayerPrefab;
public static GameObject trackingTargetPrefab;

Expand All @@ -31,13 +31,12 @@ private void Awake()
Logger = PluginLogger.GetLogger<TTIK>();
Logger.LogInfo($"Loading plugin {MyPluginInfo.PLUGIN_GUID} version {MyPluginInfo.PLUGIN_VERSION}...");

Logger.LogInfo($"{MyPluginInfo.PLUGIN_NAME} Copyright (C) {DateTime.Now.Year} Xenira");
Logger.LogInfo("This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.");
Logger.LogInfo("This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.");
Logger.LogInfo("You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.");
License.LogLicense(Logger, "xenira", MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_VERSION);

hideFlags = HideFlags.HideAndDontSave;

assetLoader = new AssetLoader(Path.Combine(Path.GetDirectoryName(Info.Location), "assets"));

ModConfig.Init(Config);

if (!ModConfig.ModEnabled())
Expand Down
13 changes: 0 additions & 13 deletions plugin/src/ik/IkPlayer.cs
Expand Up @@ -14,8 +14,6 @@ public class IkPlayer : MonoBehaviour
{
private static PluginLogger Logger = PluginLogger.GetLogger<IkPlayer>();

public static IkPlayer instance;

public GameObject avatar;
public VRIK ik;

Expand Down Expand Up @@ -67,17 +65,6 @@ public IkPlayer(TrackingTarget headTarget, TrackingTarget leftHandTarget, Tracki
this.rightHandTarget = rightHandTarget.transform;
}

private void Start()
{
if (instance != null)
{
Logger.LogWarning("IkPlayer already exists, destroying it...");
Destroy(instance.gameObject);
}

instance = this;
}

private void init()
{
Logger.LogDebug("Initializing ik player...");
Expand Down

0 comments on commit 9c0db5a

Please sign in to comment.