public void Init(MusicGenerator managerIN) { mMusicGenerator = managerIN; mTooltips = UIManager.Instance.mTooltips; mMeasureEditor = UIManager.Instance.mMeasureEditor; mInstrumentPanelUI = UIManager.Instance.mInstrumentPanelUI; mInstrumentListPanelUI = UIManager.Instance.mInstrumentListPanelUI; Component[] components = this.GetComponentsInChildren(typeof(Transform), true); foreach (Component cp in components) { if (cp.name == "SelectButton") { mSelectIcon = cp.gameObject.GetComponentInChildren <Image>(); mSelectIcon.color = Color.white; mTooltips.AddTooltip("Edit", mSelectIcon.GetComponent <RectTransform>()); } if (cp.name == "MuteToggle") { mMuteToggle = cp.gameObject.GetComponentInChildren <Toggle>(); mTooltips.AddTooltip("Mute", mMuteToggle.GetComponent <RectTransform>()); } if (cp.name == "GroupText") { mGroupText = cp.gameObject.GetComponent <Text>(); mTooltips.AddTooltip("Group", mGroupText.GetComponent <RectTransform>()); } if (cp.name == "SoloToggle") { mSoloToggle = cp.gameObject.GetComponentInChildren <Toggle>(); mTooltips.AddTooltip("Solo", mSoloToggle.GetComponent <RectTransform>()); } if (cp.name == "ColorButton") { mPanelBack = cp.gameObject.GetComponent <Image>(); } } mTooltips.AddTooltip("InstrumentDropdown", GetComponentInChildren <Dropdown>().GetComponent <RectTransform>()); }
public void Init(MusicGenerator managerIN) { mMusicGenerator = managerIN; Tooltips tooltiops = UIManager.Instance.mTooltips; Component[] components = this.GetComponentsInChildren(typeof(Transform), true); foreach (Component cp in components) { if (cp.name == "AddInstrumentPoint") { mAddInstrumentPoint = cp.gameObject.GetComponent <RectTransform>(); mBaseAddInstrumentPos = mAddInstrumentPoint.localPosition; } if (cp.name == "NewInstrumentButton") { tooltiops.AddTooltip("NewInstrument", cp.gameObject.GetComponent <RectTransform>()); } } }
public List <Toggle> mExcludedSteps = new List <Toggle>(); //< list of which steps are excluded from chord progressions public void Init() { GetComponentInParent <CanvasGroup>().interactable = false; GetComponentInParent <CanvasGroup>().blocksRaycasts = false; mUIManager = UIManager.Instance; mAnimator = GetComponentInParent <Animator>(); Component[] components = this.GetComponentsInChildren(typeof(Transform), true); mMusicGenerator = MusicGenerator.Instance; Tooltips tooltips = mUIManager.mTooltips; ChordProgressions progressions = mMusicGenerator.mChordProgressions; mTonicInfluence.value = progressions.mData.TonicInfluence; mSubdominantInfluence.value = progressions.mData.SubdominantInfluence; mDominantInfluence.value = progressions.mData.DominantInfluence; mTritoneSubInfluence.value = progressions.mData.TritoneSubInfluence; mGroupRate.value = (int)mMusicGenerator.mGeneratorData.mGroupRate; //sets up our UI elements: foreach (Component cp in components) { if (cp.name == "AsyncLoading") { tooltips.AddUIElement(ref mAsyncLoading, cp, "AsyncLoading"); } if (cp.name == "GroupRate") { tooltips.AddUIElement(ref mGroupRate, cp, "GroupRate"); } if (cp.name == "DynamicStyle") { tooltips.AddUIElement(ref mDynamicStyle, cp, "DynamicStyle"); } if (cp.name == "DominantInfluence") { tooltips.AddUIElement(ref mDominantInfluence, cp, "DominantInfluence"); } if (cp.name == "TonicInfluence") { tooltips.AddUIElement(ref mTonicInfluence, cp, "TonicInfluence"); } if (cp.name == "SubdominantInflunce") { tooltips.AddUIElement(ref mSubdominantInfluence, cp, "SubdominantInfluence"); } if (cp.name == "TritoneSubInf") { tooltips.AddUIElement(ref mTritoneSubInfluence, cp, "TritoneSubstitution"); } if (cp.name == "AscendDescendKey") { tooltips.AddUIElement(ref mAscendDescendKey, cp, "KeyAscendDescend"); } if (cp.name == "VolumeFadeRate") { tooltips.AddUIElement(ref mVolumeFadeRate, cp, "VolumeFadeRate"); } if (cp.name == "DominantInfluenceOutput") { mDominantInfluenceOutput = cp.GetComponentInChildren <Text>(); } if (cp.name == "TonicInfluenceOutput") { mTonicInfluenceOutput = cp.GetComponentInChildren <Text>(); } if (cp.name == "SubdominantInfluenceOutput") { mSubdominantInfluenceOutput = cp.GetComponentInChildren <Text>(); } if (cp.name == "TritoneSubInfOutput") { mTritoneSubInfluenceOutput = cp.GetComponentInChildren <Text>(); } if (cp.name == "AscendDescendKeyOutput") { mAscendDescendKeyOutput = cp.GetComponentInChildren <Text>(); } if (cp.name == "VolumeFadeRateOutput") { mVolumeFadeRateOutput = cp.GetComponentInChildren <Text>(); } } //these ui objects have a bunch of parts. Handled differently: for (int i = 0; i < mExcludedSteps.Count; i++) { Component[] components2 = this.GetComponentsInChildren(typeof(Transform), true); foreach (Component cp2 in components2) { if (cp2.name.Contains("Exclude")) { tooltips.AddTooltip("TonicSubdominantDominantExcludes", cp2.GetComponent <RectTransform>()); } } } }