private void FilterBoneRecordsByRequiredBonesAndCreateUnrecordedBones ( GameObject springBoneRoot, IEnumerable <string> requiredBones ) { var boneRecordsToUse = springBoneRecords .Where(record => requiredBones.Contains(record.baseData.boneName)); var recordedBoneNames = boneRecordsToUse.Select(record => record.baseData.boneName); var bonesWithoutRecords = requiredBones .Except(recordedBoneNames) .Select(boneName => GameObjectUtil.FindChildByName(springBoneRoot, boneName)) .Where(item => item != null) .Select(item => item.gameObject); foreach (var bone in bonesWithoutRecords) { var springBone = bone.AddComponent <SpringBone>(); SpringBoneSetup.CreateSpringPivotNode(springBone); } // Report the skipped bone records so the user knows var skippedBoneRecords = springBoneRecords.Except(boneRecordsToUse); foreach (var skippedRecord in skippedBoneRecords) { Debug.LogWarning(skippedRecord.baseData.boneName + "\nボーンリストにないので作成しません"); } springBoneRecords = boneRecordsToUse; }
private void togglePositionConfirmButton(bool active) { GameObject button = GameObjectUtil.FindChildByName("Canvas", "LocationConfirmButton"); if (button != null) { button.transform.GetComponent <ConfirmPositionEvent>().setTarget(target); button.SetActive(active); } }