CM3D2.SubScreen.Plugin.SubScreen.SetPreset C# (CSharp) Method

SetPreset() private method

private SetPreset ( SSPreset preset ) : void
preset SSPreset
return void
        private void SetPreset(SSPreset preset)
        {
            ssParam.bEnabled[PKeyEnable] = preset.dParams[PKeyEnable].enabled;
            bsEnable = ssParam.bEnabled[PKeyEnable];
            ssParam.bEnabled[PKeyAlwaysLookAtMaid] = preset.dParams[PKeyAlwaysLookAtMaid].enabled;

            ssParam.bEnabled[PKeyAlwaysLookAtFace] = preset.dParams[PKeyAlwaysLookAtFace].enabled;
            ssParam.fValue[PKeyAlwaysLookAtFace][PPropLookAtFaceUp] = preset.dParams[PKeyAlwaysLookAtFace].dValues[PPropLookAtFaceUp];
            ssParam.fValue[PKeyAlwaysLookAtFace][PPropLookAtFaceLeft] = preset.dParams[PKeyAlwaysLookAtFace].dValues[PPropLookAtFaceLeft];
            ssParam.fValue[PKeyAlwaysLookAtFace][PPropLookAtFaceFront] = preset.dParams[PKeyAlwaysLookAtFace].dValues[PPropLookAtFaceFront];

			ssParam.bEnabled[PKeyAlwaysLookAtXxx] = preset.dParams[PKeyAlwaysLookAtXxx].enabled;
            ssParam.fValue[PKeyAlwaysLookAtXxx][PPropLookAtXxxUp] = preset.dParams[PKeyAlwaysLookAtXxx].dValues[PPropLookAtXxxUp];
            ssParam.fValue[PKeyAlwaysLookAtXxx][PPropLookAtXxxLeft] = preset.dParams[PKeyAlwaysLookAtXxx].dValues[PPropLookAtXxxLeft];
            ssParam.fValue[PKeyAlwaysLookAtXxx][PPropLookAtXxxFront] = preset.dParams[PKeyAlwaysLookAtXxx].dValues[PPropLookAtXxxFront];

            ssParam.bEnabled[PKeyAlwaysScreenOnMainCamera] = preset.dParams[PKeyAlwaysScreenOnMainCamera].enabled;
            ssParam.fValue[PKeyAlwaysScreenOnMainCamera][PPropAlwaysScreenOnMainCameraUp] = preset.dParams[PKeyAlwaysScreenOnMainCamera].dValues[PPropAlwaysScreenOnMainCameraUp];
            ssParam.fValue[PKeyAlwaysScreenOnMainCamera][PPropAlwaysScreenOnMainCameraLeft] = preset.dParams[PKeyAlwaysScreenOnMainCamera].dValues[PPropAlwaysScreenOnMainCameraLeft];
            ssParam.fValue[PKeyAlwaysScreenOnMainCamera][PPropAlwaysScreenOnMainCameraFront] = preset.dParams[PKeyAlwaysScreenOnMainCamera].dValues[PPropAlwaysScreenOnMainCameraFront];

            ssParam.bEnabled[PKeySubCamera] = preset.dParams[PKeySubCamera].enabled;
            ssParam.fValue[PKeySubCamera][PPropSubCameraPosX] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraPosX];
            ssParam.fValue[PKeySubCamera][PPropSubCameraPosY] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraPosY];
            ssParam.fValue[PKeySubCamera][PPropSubCameraWidth] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraWidth];
            try{
                ssParam.fValue[PKeySubCamera][PPropSubCameraLocX] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraLocX];
                ssParam.fValue[PKeySubCamera][PPropSubCameraLocY] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraLocY];
                ssParam.fValue[PKeySubCamera][PPropSubCameraLocZ] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraLocZ];
                ssParam.fValue[PKeySubCamera][PPropSubCameraAngX] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraAngX];
                ssParam.fValue[PKeySubCamera][PPropSubCameraAngY] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraAngY];
                ssParam.fValue[PKeySubCamera][PPropSubCameraAngZ] = preset.dParams[PKeySubCamera].dValues[PPropSubCameraAngZ];
            }
            catch(KeyNotFoundException e){
                DebugLog("nyaaa");
            }


            ssParam.bEnabled[PKeyMainLight] = preset.dParams[PKeyMainLight].enabled;
            ssParam.fValue[PKeyMainLight][PPropMainLightLuminance] = preset.dParams[PKeyMainLight].dValues[PPropMainLightLuminance];
            ssParam.fValue[PKeyMainLight][PPropMainLightColorRed] = preset.dParams[PKeyMainLight].dValues[PPropMainLightColorRed];
            ssParam.fValue[PKeyMainLight][PPropMainLightColorGreen] = preset.dParams[PKeyMainLight].dValues[PPropMainLightColorGreen];
            ssParam.fValue[PKeyMainLight][PPropMainLightColorBlue] = preset.dParams[PKeyMainLight].dValues[PPropMainLightColorBlue];

            ssParam.bEnabled[PKeySubLight] = preset.dParams[PKeySubLight].enabled;
            ssParam.fValue[PKeySubLight][PPropSubLightRange] = preset.dParams[PKeySubLight].dValues[PPropSubLightRange];
            ssParam.fValue[PKeySubLight][PPropSubLightLuminance] = preset.dParams[PKeySubLight].dValues[PPropSubLightLuminance];
            ssParam.fValue[PKeySubLight][PPropSubLightColorRed] = preset.dParams[PKeySubLight].dValues[PPropSubLightColorRed];
            ssParam.fValue[PKeySubLight][PPropSubLightColorGreen] = preset.dParams[PKeySubLight].dValues[PPropSubLightColorGreen];
            ssParam.fValue[PKeySubLight][PPropSubLightColorBlue] = preset.dParams[PKeySubLight].dValues[PPropSubLightColorBlue];

            ssParam.fValue[PKeyCameraColor][PPropCameraColorRed] = preset.dParams[PKeyCameraColor].dValues[PPropCameraColorRed];
            ssParam.fValue[PKeyCameraColor][PPropCameraColorGreen] = preset.dParams[PKeyCameraColor].dValues[PPropCameraColorGreen];
            ssParam.fValue[PKeyCameraColor][PPropCameraColorBlue] = preset.dParams[PKeyCameraColor].dValues[PPropCameraColorBlue];
            ssParam.fValue[PKeyCameraColor][PPropCameraColorAlpha] = preset.dParams[PKeyCameraColor].dValues[PPropCameraColorAlpha];
            ssParam.fValue[PKeyCameraColor][PPropSubCameraFieldOfView] = preset.dParams[PKeyCameraColor].dValues[PPropSubCameraFieldOfView];

            ssParam.fValue[PKeyBSPos][PPropBSPosX] = preset.dParams[PKeyBSPos].dValues[PPropBSPosX];
            ssParam.fValue[PKeyBSPos][PPropBSPosY] = preset.dParams[PKeyBSPos].dValues[PPropBSPosY];
            ssParam.fValue[PKeyBSPos][PPropBSPosZ] = preset.dParams[PKeyBSPos].dValues[PPropBSPosZ];

            ssParam.fValue[PKeyBSSize][PPropBSSize] = preset.dParams[PKeyBSSize].dValues[PPropBSSize];

            ssParam.fValue[PKeyBSAngle][PPropBSAngleX] = preset.dParams[PKeyBSAngle].dValues[PPropBSAngleX];
            ssParam.fValue[PKeyBSAngle][PPropBSAngleY] = preset.dParams[PKeyBSAngle].dValues[PPropBSAngleY];
            ssParam.fValue[PKeyBSAngle][PPropBSAngleZ] = preset.dParams[PKeyBSAngle].dValues[PPropBSAngleZ];

            ssParam.fValue[PKeyBSColor][PPropScreenLightLuminance] = preset.dParams[PKeyBSColor].dValues[PPropScreenLightLuminance];
            ssParam.fValue[PKeyBSColor][PPropBSColorLuminance] = preset.dParams[PKeyBSColor].dValues[PPropBSColorLuminance];
            ssParam.fValue[PKeyBSColor][PPropBSColorRed] = preset.dParams[PKeyBSColor].dValues[PPropBSColorRed];
            ssParam.fValue[PKeyBSColor][PPropBSColorGreen] = preset.dParams[PKeyBSColor].dValues[PPropBSColorGreen];
            ssParam.fValue[PKeyBSColor][PPropBSColorBlue] = preset.dParams[PKeyBSColor].dValues[PPropBSColorBlue];
            ssParam.fValue[PKeyBSColor][PPropBSColorAlpha] = preset.dParams[PKeyBSColor].dValues[PPropBSColorAlpha];

            ssParam.bEnabled[PKeyScreenFilter] = preset.dParams[PKeyScreenFilter].enabled;
            ssParam.fValue[PKeyScreenFilter][PPropScreenFilterLuminance] = preset.dParams[PKeyScreenFilter].dValues[PPropScreenFilterLuminance];
            ssParam.fValue[PKeyScreenFilter][PPropScreenFilterRed] = preset.dParams[PKeyScreenFilter].dValues[PPropScreenFilterRed];
            ssParam.fValue[PKeyScreenFilter][PPropScreenFilterGreen] = preset.dParams[PKeyScreenFilter].dValues[PPropScreenFilterGreen];
            ssParam.fValue[PKeyScreenFilter][PPropScreenFilterBlue] = preset.dParams[PKeyScreenFilter].dValues[PPropScreenFilterBlue];
            ssParam.fValue[PKeyScreenFilter][PPropScreenFilterAlpha] = preset.dParams[PKeyScreenFilter].dValues[PPropScreenFilterAlpha];

            // 美しくないが、いい案思いつかなかった。ちかたないね
            // sub_positionにnewを指定した場合は、サブカメラのスライダー位置を反映
            if(goSubCam != null && ssParam.sub_position){
                goSubCam.transform.position = new Vector3(ssParam.fValue[PKeySubCamera][PPropSubCameraLocX],
                                                          ssParam.fValue[PKeySubCamera][PPropSubCameraLocY],
                                                          ssParam.fValue[PKeySubCamera][PPropSubCameraLocZ]);
                goSubCam.transform.eulerAngles = new Vector3(ssParam.fValue[PKeySubCamera][PPropSubCameraAngX],
                                                             ssParam.fValue[PKeySubCamera][PPropSubCameraAngY],
                                                             ssParam.fValue[PKeySubCamera][PPropSubCameraAngZ]);
             }

            DebugLog("SetPreset", preset.name);
        }