private void ReloadEffSelTab() { // 既存のToggleを削除 foreach (Transform obj in EffSelTab_Content.transform) { if (obj.name != "ToggleTemplate") { Destroy(obj.gameObject); } } // Toggleを生成 foreach (var item in EffectList) { var _toggle = Instantiate(ToggleTemplate, EffSelTab_Content.transform); _toggle.SetActive(true); _toggle.transform.Find("Label").GetComponent <Text>().text = item.Key; var toggle = _toggle.GetComponent <Toggle>(); toggle.isOn = selectedGesture.HasValue && EffectsCustomize[selectedGesture.Value].ContainsKey(item.Value); toggle.onValueChanged.AddListener((value) => { if (value) { CustomDialog.SetActive(true); // カスタマイズデータに追加 var option = new EffectOption(); option.AttachedParts = selectedParts; option.Color = ColorToFloatList(ColorList[DDColor.options[DDColor.value].text]); option.Scale = SliderScale.value; option.IsRainbow = false; EffectsCustomize[selectedGesture.Value].Add(item.Value, option); selectedEffect = item.Value; // 動きを選択するトグルの無効化 foreach (Transform _t in EffSelTab_Content.transform) { _t.GetComponent <Toggle>().interactable = false; } // OKボタンの無効化 EffSelTab.transform.Find("BtnOK").GetComponent <Button>().interactable = false; // メニューボタンの無効化 customManager.ChangeMenuTabsInteractable(false); CustomDialog.transform.Find("Text").GetComponent <Text>().text = item.Key; TransitionState = 1; } else { // カスタマイズデータから削除 EffectsCustomize[selectedGesture.Value].Remove(item.Value); } }); } }
private void SetDefault() { foreach (var item in EffectsCustomize) { item.Value.Clear(); } // ラインエフェクト { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "HandTipLeft", "HandTipRight", "FootLeft", "FootRight" }; eOption.IsRainbow = true; eOption.Scale = 1.0f; EffectsCustomize[Gesture.Always].Add(Effect.Line, eOption); } // パンチ { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "HandTipLeft", "HandTipRight" }; eOption.Color = ColorToFloatList(Color.blue); eOption.IsRainbow = false; eOption.Scale = 1.0f; EffectsCustomize[Gesture.Punch].Add(Effect.Ripple, eOption); } // ジャンプ { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "Body" }; eOption.Color = ColorToFloatList(Color.yellow); eOption.IsRainbow = false; eOption.Scale = 1.0f; EffectsCustomize[Gesture.Jump].Add(Effect.Impact, eOption); } // 拍手 { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "HandTipLeft", "HandTipRight" }; eOption.Color = ColorToFloatList(Color.yellow); eOption.IsRainbow = false; eOption.Scale = 1.0f; EffectsCustomize[Gesture.ChimpanzeeClap].Add(Effect.Clap, eOption); } // Daisuke { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "Head" }; eOption.Color = ColorToFloatList(Color.yellow); eOption.IsRainbow = false; eOption.Scale = 1.0f; EffectsCustomize[Gesture.Daisuke].Add(Effect.Impact, eOption); } // かめはめ波 { var eOption = new EffectOption(); eOption.AttachedParts = new List <string>() { "HandLeft" }; eOption.Color = ColorToFloatList(Color.yellow); eOption.IsRainbow = false; eOption.Scale = 1.0f; EffectsCustomize[Gesture.Kamehameha].Add(Effect.Beam, eOption); } }