Skip to content

Commit

Permalink
Merge pull request #3 from MidraLab/develop
Browse files Browse the repository at this point in the history
v0.0.3
  • Loading branch information
ayutaz authored Aug 6, 2023
2 parents 8b2ac51 + 0664cce commit c76189e
Show file tree
Hide file tree
Showing 33 changed files with 397 additions and 258 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/activation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2
with:
unityVersion: 2022.2.5f1
unityVersion: 2022.2.15f1
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v3.1.1
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/build.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/check-meta-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
pull_request:
branches:
- main
- develop

jobs:
meta-check:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- main
- develop

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
8 changes: 8 additions & 0 deletions Assets/EasyADV/BackgroundImage.meta

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

Empty file.
8 changes: 8 additions & 0 deletions Assets/EasyADV/CharacterImage.meta

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

Empty file.
8 changes: 8 additions & 0 deletions Assets/EasyADV/Prefabs.meta

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

92 changes: 92 additions & 0 deletions Assets/EasyADV/Prefabs/Background.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7114562640169053628
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 997822693772618305}
- component: {fileID: 2866147896293219298}
- component: {fileID: 45360905756024039}
- component: {fileID: 1689601321579300571}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &997822693772618305
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7114562640169053628}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: -1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2866147896293219298
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7114562640169053628}
m_CullTransparentMesh: 1
--- !u!114 &45360905756024039
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7114562640169053628}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1689601321579300571
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7114562640169053628}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a1f4d01e48c9499f80ebc24e695fa593, type: 3}
m_Name:
m_EditorClassIdentifier:
backgroundSprites: []
7 changes: 7 additions & 0 deletions Assets/EasyADV/Prefabs/Background.prefab.meta

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

24 changes: 0 additions & 24 deletions Assets/EasyADV/Scripts/DataModel/CharacterVoiceSetting.cs

This file was deleted.

This file was deleted.

7 changes: 6 additions & 1 deletion Assets/EasyADV/Scripts/DataModel/ScenarioData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace EasyADV.DataModel
{
/// <summary>
/// シナリオデータ
/// </summary>
[Serializable]
public class ScenarioData
{
Expand All @@ -11,10 +14,12 @@ public class ScenarioData
public string characterName;
public string command;
public string content;
public string description;
public string sound;
}

/// <summary>
/// シナリオデータリスト
/// </summary>
[Serializable]
public class ScenarioDataList
{
Expand Down
1 change: 0 additions & 1 deletion Assets/EasyADV/Scripts/EasyADV.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:cc04cd67926c76747844771fb8e474a5",
"GUID:34cf00d3f10a8f34783a2f8b914a0219"
],
"includePlatforms": [],
Expand Down
125 changes: 125 additions & 0 deletions Assets/EasyADV/Scripts/Editor/EasyADVMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
using System.IO;
using EasyADV.FungusExtension;
using EasyADV.Scripts;
using Fungus;
using UnityEditor;
using UnityEngine;

namespace EasyADV.Editor
{
/// <summary>
/// EasyADVのメニューを追加するクラス
/// </summary>
public class EasyADVMenu
{
/// <summary>
/// 背景画像のフォルダ名
/// </summary>
private const string BackgroundImageFolderName = "BackgroundImage";

/// <summary>
/// キャラクター画像のフォルダ名
/// </summary>
private const string CharacterImageFolderName = "CharacterImage";

/// <summary>
/// サウンドのフォルダ名
/// </summary>
private const string SoundFolderName = "Sound";

[MenuItem("Tools/EasyADV/Setup")]
private static void Setup()
{
SetupHierarchyObject();
SetupMaterialFolder();
}

/// <summary>
/// 素材フォルダを作成する
/// </summary>
private static void SetupMaterialFolder()
{
var folderRoot = Application.dataPath + "/EasyADV/";

// 背景画像フォルダがなければ作成
if (!Directory.Exists(folderRoot + BackgroundImageFolderName))
{
Directory.CreateDirectory(folderRoot + BackgroundImageFolderName);
CreateGitKeep(Path.Combine(folderRoot, BackgroundImageFolderName));
}

// キャラクター画像フォルダがなければ作成
if (!Directory.Exists(folderRoot + CharacterImageFolderName))
{
Directory.CreateDirectory(folderRoot + CharacterImageFolderName);
CreateGitKeep(Path.Combine(folderRoot, CharacterImageFolderName));
}

// サウンドフォルダがなければ作成
if (!Directory.Exists(folderRoot + SoundFolderName))
{
Directory.CreateDirectory(folderRoot + SoundFolderName);
CreateGitKeep(Path.Combine(folderRoot, SoundFolderName));
}

AssetDatabase.Refresh();
}

/// <summary>
/// Fungus・EasyADVを使用するためのオブジェクトを作成する
/// </summary>
private static void SetupHierarchyObject()
{
if (Object.FindObjectOfType<Flowchart>() == null)
{
Fungus.EditorUtils.FlowchartMenuItems.CreateFlowchart();
}

if(Object.FindObjectOfType<Stage>() == null)
{
Fungus.EditorUtils.NarrativeMenuItems.CreateStage();
}

if (Object.FindObjectOfType<SayDialog>() == null)
{
Fungus.EditorUtils.NarrativeMenuItems.CreateSayDialog();
}

// FlowchartにUpdateScenarioFromGoogleSheetコンポーネントが追加されていなければ追加
var flowchart = Object.FindObjectOfType<Flowchart>();
if (flowchart == null || flowchart.GetComponent<UpdateScenarioFromGoogleSheet>() != null)
{
return;
}

flowchart.gameObject.AddComponent<UpdateScenarioFromGoogleSheet>();

// ステージ内に背景画 切り替え用のオブジェクトとコンポーネントの追加
var stageCanvas = Object.FindObjectOfType<Stage>().GetComponentInChildren<Canvas>();
if (stageCanvas.GetComponentInChildren<SetBackgroundImage>() != null)
{
return;
}

var backgroundPrefab =
AssetDatabase.LoadAssetAtPath<SetBackgroundImage>("Assets/EasyADV/Prefabs/Background.prefab");
var backgroundObject = Object.Instantiate(backgroundPrefab, stageCanvas.transform);
backgroundObject.name = "Background";
}

/// <summary>
/// Gitの管理下に置くためのファイルを作成する
/// </summary>
/// <param name="path"></param>
private static void CreateGitKeep(string path)
{
var gitKeepPath = path + "/.gitkeep";
if (File.Exists(gitKeepPath))
{
return;
}

File.Create(gitKeepPath);
}
}
}
Loading

0 comments on commit c76189e

Please sign in to comment.