Skip to content

Commit

Permalink
Merge pull request #74 from enpitut2019/aojiru_1118
Browse files Browse the repository at this point in the history
ボタンの残り日数の表示の変更
  • Loading branch information
Aojilu authored Nov 18, 2019
2 parents 9a05320 + 64ae6ce commit 068e02a
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 14 deletions.
311 changes: 311 additions & 0 deletions Assets/Prefab/PlaceDataButton.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1937658540338841396
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 536362859364056204}
- component: {fileID: 4786355366862777350}
- component: {fileID: 6413193610772337964}
m_Layer: 5
m_Name: limitTime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &536362859364056204
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1937658540338841396}
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_Children: []
m_Father: {fileID: 8097759134289559650}
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: 81.82501, y: 0}
m_SizeDelta: {x: -163.65, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4786355366862777350
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1937658540338841396}
m_CullTransparentMesh: 0
--- !u!114 &6413193610772337964
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1937658540338841396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 82
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 14
m_MaxSize: 82
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Button
--- !u!1 &6353647976271927709
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8097759134289559650}
- component: {fileID: 7226254132798090550}
- component: {fileID: 4017220420071378545}
- component: {fileID: 398985314969304470}
- component: {fileID: 4266080359689815398}
- component: {fileID: 7296051779640070793}
m_Layer: 5
m_Name: PlaceDataButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8097759134289559650
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
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_Children:
- {fileID: 2286364264971667136}
- {fileID: 536362859364056204}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 474.5988, y: 266.69095}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7226254132798090550
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
m_CullTransparentMesh: 0
--- !u!114 &4017220420071378545
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
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_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
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 &398985314969304470
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4017220420071378545}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!114 &4266080359689815398
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: 1
m_MinHeight: 83.1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &7296051779640070793
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6353647976271927709}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 050c881062c8c2447bae9c339d2863ca, type: 3}
m_Name:
m_EditorClassIdentifier:
placeText: {fileID: 2222667252034976192}
limitText: {fileID: 6413193610772337964}
--- !u!1 &8456519888541770355
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2286364264971667136}
- component: {fileID: 7253967428476693798}
- component: {fileID: 2222667252034976192}
m_Layer: 5
m_Name: placeName
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2286364264971667136
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8456519888541770355}
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_Children: []
m_Father: {fileID: 8097759134289559650}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -72.2, y: 0}
m_SizeDelta: {x: -144.3, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7253967428476693798
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8456519888541770355}
m_CullTransparentMesh: 0
--- !u!114 &2222667252034976192
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8456519888541770355}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 82
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 14
m_MaxSize: 82
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Button
7 changes: 7 additions & 0 deletions Assets/Prefab/PlaceDataButton.prefab.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/Scenes/MainScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -5243,7 +5243,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d3cce1183fc3224459320fa72f79de0d, type: 3}
m_Name:
m_EditorClassIdentifier:
textPrefab: {fileID: 5571647834793167347, guid: b4f3cb7a69bd21c4eb9acaee925bc519,
textPrefab: {fileID: 6353647976271927709, guid: 582cce5389ab50c4fac632a5de4ae99e,
type: 3}
main_ui: {fileID: 648793232}
--- !u!114 &1606562829
Expand Down
15 changes: 9 additions & 6 deletions Assets/Script/LayOutTextList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ private void Awake()
/// <summary>
/// textをLayOutに追加する
/// </summary>
/// <param name="st"></param>
public void AddText(string st)
/// <param name="data"></param>
public void AddText(CleanPlaceData data)
{
//ボタンの生成
var obj = Instantiate(textPrefab, rtr.position, Quaternion.identity);
textButtonList.Add(obj);

Expand All @@ -31,8 +32,10 @@ public void AddText(string st)
objRtr.localScale = new Vector3(1, 1, 1);

//テキストの書き換え
var t= obj.GetComponentInChildren<Text>();
t.text = st;
//var t= obj.GetComponentInChildren<Text>();
//t.text = data;
var test = obj.GetComponent<PlaceButtonLayout>();
test.SetCleanPlaceData(data);

//ボタンに関数を追加
var button = obj.GetComponent<Button>();
Expand Down Expand Up @@ -61,11 +64,11 @@ public void ResetText()
}


[ContextMenu("addText")]
/*[ContextMenu("addText")]
public void Test_AddText()
{
AddText("unko"+textButtonList.Count);
}
}*/


[ContextMenu("removeText")]
Expand Down
5 changes: 3 additions & 2 deletions Assets/Script/Main_UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ void DisplayData()
layoutTextList.ResetText();
for (int i = 0; i < cleanDataList.placeDataList.Count; i++)
{
layoutTextList.AddText(cleanDataList.GetPlaceData(i)+
" あと"+cleanDataList.GetCleanPlaceData(i).NextCleanLeftTimeText);
layoutTextList.AddText(cleanDataList.placeDataList[i]);
/*layoutTextList.AddText(cleanDataList.GetPlaceData(i)+
" あと"+cleanDataList.GetCleanPlaceData(i).NextCleanLeftTimeText);*/
}
}

Expand Down
Loading

0 comments on commit 068e02a

Please sign in to comment.