private void Start() { if (settings == null) { Debug.LogError("DESTROYING SELF. InputSettings were not initialized."); Destroy(this); return; } spellCasterRight = Instantiate(settings.spellCasterPrefab, transform); spellCasterLeft = Instantiate(settings.spellCasterPrefab, transform); gestureRecorder = gameObject.AddComponent <GestureRecorder>(); gestureRecorder.filename = settings.gestureFile; gestures = Resources.LoadAll <GestureData>(""); OSCReceiver[] temp = GetComponentsInChildren <OSCReceiver>(); if (temp.Length != 2) { Debug.LogError("Expected to find exactly two OSCReceivers."); } else if (temp[0] != null && !temp[0].Equals(null) && temp[1] != null && !temp[1].Equals(null)) { if (temp[0].IsLeft) { oscReceiverLeft = temp[0]; oscReceiverRight = temp[1]; } else { oscReceiverRight = temp[0]; oscReceiverLeft = temp[1]; } foreach (GestureData item in gestures) { if (item.wekinatorAddress == "" || item.wekinatorAddress == null) { continue; } gestureDict.Add(item.wekinatorAddress, item); if (item.wekinatorAddress.ToLower().Contains("left")) { oscReceiverLeft.AddAddress(item.wekinatorAddress); } else if (item.wekinatorAddress.ToLower().Contains("right")) { oscReceiverRight.AddAddress(item.wekinatorAddress); } } } if (settings.useFingertipMode) { if (settings.leftThumb) { settings.leftThumb.spellCaster = this.spellCasterLeft; } if (settings.rightThumb) { settings.rightThumb.spellCaster = this.spellCasterRight; } } }