Skip to content

Commit

Permalink
Merge pull request #229 from sfc-sdp/feature/#227
Browse files Browse the repository at this point in the history
GameCanvas 6.5.0
  • Loading branch information
seibe authored Apr 13, 2024
2 parents da1df84 + b3d15db commit eaeb3d3
Show file tree
Hide file tree
Showing 240 changed files with 1,220 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
strategy:
matrix:
unity-version:
- 2022.3.10f1
- 2022.3.24f1
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
Expand Down
18 changes: 18 additions & 0 deletions Assets/Game.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Game",
"rootNamespace": "",
"references": [
"GUID:d8b63aba1907145bea998dd612889d6b",
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:1b735e4770e5be346a2bafdd22e488d7"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Assets/Game.asmdef.meta

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

2 changes: 1 addition & 1 deletion Assets/GameCanvas/AutoGeneratedScripts/GcFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <summary>GameCanvas for Unity</summary>
// <author>Seibe TAKAHASHI</author>
// <remarks>
// (c) 2015-2023 Smart Device Programming.
// (c) 2015-2024 Smart Device Programming.
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// </remarks>
Expand Down
2 changes: 1 addition & 1 deletion Assets/GameCanvas/AutoGeneratedScripts/GcImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <summary>GameCanvas for Unity</summary>
// <author>Seibe TAKAHASHI</author>
// <remarks>
// (c) 2015-2023 Smart Device Programming.
// (c) 2015-2024 Smart Device Programming.
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// </remarks>
Expand Down
2 changes: 1 addition & 1 deletion Assets/GameCanvas/AutoGeneratedScripts/GcSound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <summary>GameCanvas for Unity</summary>
// <author>Seibe TAKAHASHI</author>
// <remarks>
// (c) 2015-2023 Smart Device Programming.
// (c) 2015-2024 Smart Device Programming.
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// </remarks>
Expand Down
2 changes: 1 addition & 1 deletion Assets/GameCanvas/AutoGeneratedScripts/GcText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <summary>GameCanvas for Unity</summary>
// <author>Seibe TAKAHASHI</author>
// <remarks>
// (c) 2015-2023 Smart Device Programming.
// (c) 2015-2024 Smart Device Programming.
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// </remarks>
Expand Down
2 changes: 2 additions & 0 deletions Assets/csc.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-nullable
-langversion:latest
7 changes: 7 additions & 0 deletions Assets/csc.rsp.meta

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

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2023 Smart Device Programming
Copyright (c) 2015-2024 Smart Device Programming

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LICENSE_JP
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2023 スマートデバイスプログラミング
Copyright (c) 2015-2024 スマートデバイスプログラミング

以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフト
ウェア」)の複製を取得するすべての人に対し、ソフトウェアを無制限に扱うことを
Expand Down
6 changes: 3 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GameCanvas for Unity is built using open source software:

* RuntimeUnitTestToolkit (MIT License)
* CsprojModifier (MIT License)
* PixelMplus (M+ FONT LICENSE)

--
RuntimeUnitTestToolkit is:
CsprojModifier is:

Copyright (c) 2017 Yoshifumi Kawai
Copyright (c) 2021 Cysharp, Inc.

--
PixelMplus is:
Expand Down
8 changes: 8 additions & 0 deletions Packages/CsprojModifier/Editor.meta

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

31 changes: 31 additions & 0 deletions Packages/CsprojModifier/Editor/CsprojModifier.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "CsprojModifier.Editor",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.ide.rider",
"expression": "2.0.6",
"define": "HAS_ROSLYN_ANALZYER_SUPPORT_RIDER"
},
{
"name": "com.unity.ide.rider",
"expression": "3.0.2",
"define": "HAS_ROSLYN_ANALZYER_SUPPORT_RIDER_3_0_2_OR_NEWER"
},
{
"name": "com.unity.ide.vscode",
"expression": "1.2.0",
"define": "HAS_ROSLYN_ANALZYER_SUPPORT_VSCODE"
}
],
"noEngineReferences": false
}

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

39 changes: 39 additions & 0 deletions Packages/CsprojModifier/Editor/CsprojModifierFeatureProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Collections.Generic;
using System.Linq;
using CsprojModifier.Editor.Features;
using UnityEditor;

namespace CsprojModifier.Editor
{
public class CsprojModifierFeatureProvider : AssetPostprocessor
{
private static readonly List<ICsprojModifierFeature> _features = new List<ICsprojModifierFeature>()
{
new InsertAdditionalImportFeature(),
new AddAnalyzerReferenceFeature(),
new RegenerateProjectFeature(),
};

public static List<ICsprojModifierFeature> Features => _features;

private static bool OnPreGeneratingCSProjectFiles()
=> _features.OfType<ICsprojModifierGeneratedFileProcessor>().Aggregate(false, (r, x) => x.OnPreGeneratingCSProjectFiles() || r);
private static string OnGeneratedCSProject(string path, string content)
=> _features.OfType<ICsprojModifierGeneratedFileProcessor>().Aggregate(content, (r, x) => x.OnGeneratedCSProject(path, r));

#if UNITY_2018_1_OR_NEWER && HAS_ROSLYN_ANALZYER_SUPPORT_RIDER_3_0_2_OR_NEWER
#else
private static void OnGeneratedCSProjectFiles()
{
foreach (var feature in _features.OfType<ICsprojModifierGeneratedFileProcessor>())
{
feature.OnGeneratedCSProjectFiles();
}
}
#endif

private static string OnGeneratedSlnSolution(string path, string content)
=> _features.OfType<ICsprojModifierGeneratedFileProcessor>().Aggregate(content, (r, x) => x.OnGeneratedSlnSolution(path, r));

}
}

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

77 changes: 77 additions & 0 deletions Packages/CsprojModifier/Editor/CsprojModifierSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;

namespace CsprojModifier.Editor
{
public class CsprojModifierSettings : ScriptableObject
{
private const string SettingsPath = "ProjectSettings/CsprojModifierSettings.json";

private static CsprojModifierSettings _instance;
public static CsprojModifierSettings Instance
{
get
{
if (_instance != null)
return _instance;

_instance = LoadOrNew();

return _instance;
}
}

#region Settings
public List<ImportProjectItem> AdditionalImports;
public List<string> AdditionalImportsAdditionalProjects;

public bool EnableAddAnalyzerReferences;
public List<string> AddAnalyzerReferencesAdditionalProjects;
#endregion


public CsprojModifierSettings()
{
AdditionalImports = new List<ImportProjectItem>();
AdditionalImportsAdditionalProjects = new List<string>();
AddAnalyzerReferencesAdditionalProjects = new List<string>();
}

private static CsprojModifierSettings LoadOrNew()
{
if (File.Exists(SettingsPath))
{
var instance = CreateInstance<CsprojModifierSettings>();
JsonUtility.FromJsonOverwrite(File.ReadAllText(SettingsPath), instance);
return instance;
}
else
{
var instance = CreateInstance<CsprojModifierSettings>();
return instance;
}
}

public void Save()
{
File.WriteAllText(SettingsPath, JsonUtility.ToJson(_instance));
}
}

public enum ImportProjectPosition
{
Append,
Prepend,
AppendContent,
PrependContent,
}

[Serializable]
public class ImportProjectItem
{
public string Path;
public ImportProjectPosition Position;
}
}
11 changes: 11 additions & 0 deletions Packages/CsprojModifier/Editor/CsprojModifierSettings.cs.meta

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

65 changes: 65 additions & 0 deletions Packages/CsprojModifier/Editor/CsprojModifierSettingsProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

namespace CsprojModifier.Editor
{
public class CsprojModifierSettingsProvider : SettingsProvider
{
private static class Styles
{
public static readonly GUIStyle VerticalStyle;

static Styles()
{
VerticalStyle = new GUIStyle(EditorStyles.inspectorFullWidthMargins);
VerticalStyle.margin = new RectOffset(10, 10, 10, 10);
}
}
public CsprojModifierSettingsProvider(string path, SettingsScope scopes, IEnumerable<string> keywords = null) : base(path, scopes, keywords)
{
}

[SettingsProvider]
public static SettingsProvider Create()
=> new CsprojModifierSettingsProvider("Project/Editor/C# Project Modifier", SettingsScope.Project, new[] { "Analyzer", "C#", "csproj", "Project", "Import" } /* TODO */);

public override void OnActivate(string searchContext, VisualElement rootElement)
{
Initialize();
base.OnActivate(searchContext, rootElement);
}

public override void OnGUI(string searchContext)
{
using (new EditorGUILayout.VerticalScope(Styles.VerticalStyle))
{
foreach (var feature in CsprojModifierFeatureProvider.Features)
{
feature.OnGUI();
GUILayout.Space(10);
}
}

if (GUI.changed)
{
CsprojModifierSettings.Instance.Save();
}
}

private void Initialize()
{
foreach (var feature in CsprojModifierFeatureProvider.Features)
{
feature.Initialize();
}
}
}
}

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

8 changes: 8 additions & 0 deletions Packages/CsprojModifier/Editor/Features.meta

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

Loading

0 comments on commit eaeb3d3

Please sign in to comment.