Skip to content

Commit

Permalink
feat: 2018.3bだとSerializeField使ってると警告出るのでやめる
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubuns committed Oct 6, 2018
1 parent cd883b3 commit 7b8f6a0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Assets/AnimeTask/Sample/Sample.unity
Expand Up @@ -636,8 +636,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3f58208be3020414085ce2784270fed9, type: 3}
m_Name:
m_EditorClassIdentifier:
sample: {fileID: 395197740}
dropdown: {fileID: 1967098724}
Sample: {fileID: 395197740}
Dropdown: {fileID: 1967098724}
--- !u!1 &835844139
GameObject:
m_ObjectHideFlags: 0
Expand Down
47 changes: 24 additions & 23 deletions Assets/AnimeTask/Sample/SampleMenu.cs
@@ -1,23 +1,24 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace AnimeTask.Sample
{
public class SampleMenu : MonoBehaviour
{
[SerializeField] private Sample sample;
[SerializeField] private Dropdown dropdown;
private readonly List<Dropdown.OptionData> list = new List<Dropdown.OptionData>
{
new Dropdown.OptionData("Sample01"),
};

public void Start()
{
dropdown.options = list;
dropdown.onValueChanged.AddListener(x => { sample.Invoke(list[x].text, 0.0f); });
sample.Invoke(list[0].text, 0.0f);
}
}
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace AnimeTask.Sample
{
public class SampleMenu : MonoBehaviour
{
public Sample Sample;
public Dropdown Dropdown;

private readonly List<Dropdown.OptionData> list = new List<Dropdown.OptionData>
{
new Dropdown.OptionData("Sample01"),
};

public void Start()
{
Dropdown.options = list;
Dropdown.onValueChanged.AddListener(x => { Sample.Invoke(list[x].text, 0.0f); });
Sample.Invoke(list[0].text, 0.0f);
}
}
}

0 comments on commit 7b8f6a0

Please sign in to comment.