public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); if (itsDataMapIcon.itsCategory == string.Empty) { aMessageList.AddError("itsDataMapIcon.itsCategory is empty"); } if (itsDataMapIcon.itsTextureIcon == null) { aMessageList.AddError("itsDataMapIcon.itsTextureIcon is null"); } return(aMessageList); }
/// <summary> /// Get errors /// </summary> /// <returns></returns> public KGFMessageList GetErrors() { KGFMessageList aMessageList = new KGFMessageList(); if (string.IsNullOrEmpty(itsMethodName)) { aMessageList.AddError("Empty method name"); } if (itsRuntimeObjectSearch) { if (string.IsNullOrEmpty(itsRuntimeObjectSearchType)) { aMessageList.AddError("Empty type field"); } } MethodInfo aFoundMethod; MonoBehaviour aFoundComponent; if (!FindMethod(this, out aFoundMethod, out aFoundComponent)) { aMessageList.AddError("Could not find method on object."); } else { ParameterInfo[] aParameterInfos = aFoundMethod.GetParameters(); for (int i = 0; i < itsParameters.Length; i++) { if (!GetIsParameterLinked(i)) { if (typeof(UnityEngine.Object).IsAssignableFrom(aParameterInfos[i].ParameterType)) { if (itsParameters[i].itsValueUnityObject == null) { aMessageList.AddError("Empty unity object in parameters"); } } } } } return(aMessageList); }
/// <summary> /// Checks for errors in the inspector /// </summary> public override KGFMessageList Validate() { KGFMessageList aReturnValue = new KGFMessageList(); bool aHasNullEvent = false; bool aWaitBeforeError = false; bool aWaitAfterError = false; if (itsEntries != null) { for (int i = 0; i < itsEntries.Count; i++) { KGFEventSequenceEntry anEntry = itsEntries[i]; if (anEntry.itsEvent == null) { aHasNullEvent = true; } if (anEntry.itsWaitBefore < 0) { aWaitBeforeError = true; } if (anEntry.itsWaitAfter < 0) { aWaitAfterError = true; } } } if (aHasNullEvent) { aReturnValue.AddError("sequence entry has null event"); } if (aWaitBeforeError) { aReturnValue.AddError("sequence entry itsWaitBefore <= 0"); } if (aWaitAfterError) { aReturnValue.AddError("sequence entry itsWaitAfter <= 0"); } return(aReturnValue); }
public KGFMessageList Validate() { KGFMessageList aList = new KGFMessageList(); if (itsCamera == null) { aList.AddError("KGFCutscene can only be used in combination with a camera"); } return(aList); }
public KGFMessageList Validate() { KGFMessageList aList = new KGFMessageList(); if (itsCamera == null) { aList.AddError("KGFCutscene can only be used in combination with a camera"); } return aList; }
/// <summary> /// /// </summary> /// <returns></returns> public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); if (itsGlobalSettings.itsGeometry == null) { aMessageList.AddError("its Geometry should nor be empty. Assign a character."); } if (itsGlobalSettings.itsMass <= 0) { aMessageList.AddError("its Mass should be > 0."); } if (itsGlobalSettings.itsThickness <= 0) { aMessageList.AddError("its Thickness should be > 0."); } if (itsGlobalSettings.itsHeight <= 0) { aMessageList.AddError("its Height should be > 0."); } if (itsPointNavigationSettings.itsClickTargetRepesentationOK == null) { aMessageList.AddError("itsClickTargetRepesentationOK should not be empty. Assign a projector"); } if (itsPointNavigationSettings.itsClickTargetRepesentationNotOK == null) { aMessageList.AddError("itsClickTargetRepesentationNotOK should not be empty. Assign a projector"); } if (itsPointNavigationSettings.itsClickTargetRepesentationOKDouble == null) { aMessageList.AddError("itsClickTargetRepesentationOKDouble should not be empty. Assign a projector"); } if (itsPointNavigationSettings.itsClickTargetRepesentationNotOKDouble == null) { aMessageList.AddError("itsClickTargetRepesentationNotOKDouble should not be empty. Assign a projector"); } return(aMessageList); }
public override KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); if (itsDataDebugFile.itsSeparator.Length == 0) { aMessageList.AddInfo("no seperator is set"); } if (itsDataDebugFile.itsFilePath == string.Empty) { aMessageList.AddInfo("no file path set. path will be set to desktop."); } else { if (!Directory.Exists(Path.GetDirectoryName(itsDataDebugFile.itsFilePath))) { aMessageList.AddError("the current directory doesn`t exist"); } } return(aMessageList); }
/// <summary> /// Checks for errors in the inspector /// </summary> public override KGFMessageList Validate() { KGFMessageList aReturnValue = new KGFMessageList(); bool aHasNullEvent = false; bool aWaitBeforeError = false; bool aWaitAfterError = false; if (itsEntries != null) { for (int i=0; i<itsEntries.Count; i++) { KGFEventSequenceEntry anEntry = itsEntries[i]; if (anEntry.itsEvent == null) aHasNullEvent = true; if (anEntry.itsWaitBefore < 0) aWaitBeforeError = true; if (anEntry.itsWaitAfter < 0) aWaitAfterError = true; } } if (aHasNullEvent) aReturnValue.AddError("sequence entry has null event"); if (aWaitBeforeError) aReturnValue.AddError("sequence entry itsWaitBefore <= 0"); if (aWaitAfterError) aReturnValue.AddError("sequence entry itsWaitAfter <= 0"); return aReturnValue; }
void PositiveError(ref KGFMessageList theMessageList,string theName, float theValue) { if (theValue < 0) { theMessageList.AddError(string.Format("{0} must be positive",theName)); } }
public override KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); // main RegionError(ref aMessageList,"itsDataModuleMinimap.itsStaticNorth",itsDataModuleMinimap.itsGlobalSettings.itsStaticNorth,0,360); if (itsDataModuleMinimap.itsGlobalSettings.itsTarget == null) { aMessageList.AddError("itsTarget must not be null. Please add a target that is always centered on the minimap (e.g.: the character)."); } // appearance minimap if (itsDataModuleMinimap.itsAppearanceMiniMap.itsMask != null && !GetHasProVersion()) { aMessageList.AddWarning("Masking texture does only work in Unity Pro version. (itsAppearanceMiniMap.itsMask)"); } RegionError(ref aMessageList,"itsAppearanceMiniMap.itsSize",itsDataModuleMinimap.itsAppearanceMiniMap.itsSize,0,1); RegionError(ref aMessageList,"itsAppearanceMiniMap.itsButtonSize",itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonSize,0,1); RegionError(ref aMessageList,"itsAppearanceMiniMap.itsButtonPadding",itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonPadding,0,1); RegionError(ref aMessageList,"itsAppearanceMiniMap.itsScaleArrows",itsDataModuleMinimap.itsAppearanceMiniMap.itsScaleArrows,0,1); RegionError(ref aMessageList,"itsAppearanceMiniMap.itsScaleIcons",itsDataModuleMinimap.itsAppearanceMiniMap.itsScaleIcons,0,1); RegionError(ref aMessageList,"itsAppearanceMiniMap.itsRadiusArrows",itsDataModuleMinimap.itsAppearanceMiniMap.itsRadiusArrows,0,1); PositiveError(ref aMessageList,"itsAppearanceMiniMap.itsBackgroundBorder",itsDataModuleMinimap.itsAppearanceMiniMap.itsBackgroundBorder); if (itsDataModuleMinimap.itsAppearanceMiniMap.itsBackground == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsBackground)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsButton == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsButton)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonDown == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsButtonDown)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonHover == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsButtonHover)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomIn == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsIconZoomIn)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomOut == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsIconZoomOut)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomLock == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsIconZoomLock)"); } if (itsDataModuleMinimap.itsAppearanceMiniMap.itsIconFullscreen == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearance.itsIconFullscreen)"); } // appearance map RegionError(ref aMessageList,"itsAppearanceMap.itsButtonSize",itsDataModuleMinimap.itsAppearanceMap.itsButtonSize,0,1); RegionError(ref aMessageList,"itsAppearanceMap.itsButtonPadding",itsDataModuleMinimap.itsAppearanceMap.itsButtonPadding,0,1); RegionError(ref aMessageList,"itsAppearanceMap.itsButtonSpace",itsDataModuleMinimap.itsAppearanceMap.itsButtonSpace,0,1); RegionError(ref aMessageList,"itsAppearanceMap.itsScaleIcons",itsDataModuleMinimap.itsAppearanceMap.itsScaleIcons,0,1); PositiveError(ref aMessageList,"itsAppearanceMap.itsBackgroundBorder",itsDataModuleMinimap.itsAppearanceMap.itsBackgroundBorder); if (itsDataModuleMinimap.itsGlobalSettings.itsColorAll != Color.white && !GetHasProVersion()) { aMessageList.AddError("itsColorAll does only work in Unity Pro version. (itsColorAll)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsMask != null && !GetHasProVersion()) { aMessageList.AddWarning("Masking texture does only work in Unity Pro version. (itsAppearanceMap.itsMask)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsButton == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsButton)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsButtonDown == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsButtonDown)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsButtonHover == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsButtonHover)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsIconZoomIn == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsIconZoomIn)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsIconZoomOut == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsIconZoomOut)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsIconZoomLock == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsIconZoomLock)"); } if (itsDataModuleMinimap.itsAppearanceMap.itsIconFullscreen == null) { aMessageList.AddWarning("Appearance texture should be set (itsAppearanceMap.itsIconFullscreen)"); } // fog-of-war PositiveError(ref aMessageList,"itsFogOfWar.itsResolutionX",itsDataModuleMinimap.itsFogOfWar.itsResolutionX); PositiveError(ref aMessageList,"itsFogOfWar.itsResolutionY",itsDataModuleMinimap.itsFogOfWar.itsResolutionY); PositiveError(ref aMessageList,"itsFogOfWar.itsRevealDistance",itsDataModuleMinimap.itsFogOfWar.itsRevealDistance); PositiveError(ref aMessageList,"itsFogOfWar.itsRevealedFullDistance",itsDataModuleMinimap.itsFogOfWar.itsRevealedFullDistance); if (itsDataModuleMinimap.itsFogOfWar.itsRevealedFullDistance > itsDataModuleMinimap.itsFogOfWar.itsRevealDistance) { aMessageList.AddError("itsFogOfWar.itsRevealDistance must be bigger than itsFogOfWar.itsRevealedFullDistance"); } // zoom minimap PositiveError(ref aMessageList,"itsZoomMiniMap.itsZoomChangeValue",itsDataModuleMinimap.itsZoomMiniMap.itsZoomChangeValue); PositiveError(ref aMessageList,"itsZoomMiniMap.itsZoomMax",itsDataModuleMinimap.itsZoomMiniMap.itsZoomMax); PositiveError(ref aMessageList,"itsZoomMiniMap.itsZoomMin",itsDataModuleMinimap.itsZoomMiniMap.itsZoomMin); PositiveError(ref aMessageList,"itsZoomMiniMap.itsZoomStartValue",itsDataModuleMinimap.itsZoomMiniMap.itsZoomStartValue); if (itsDataModuleMinimap.itsZoomMiniMap.itsZoomMin > itsDataModuleMinimap.itsZoomMiniMap.itsZoomMax) { aMessageList.AddError("itsZoomMiniMap.itsZoomMax must be bigger than itsZoomMiniMap.itsZoomMin"); } if (itsDataModuleMinimap.itsZoomMiniMap.itsZoomStartValue < itsDataModuleMinimap.itsZoomMiniMap.itsZoomMin || itsDataModuleMinimap.itsZoomMiniMap.itsZoomStartValue > itsDataModuleMinimap.itsZoomMiniMap.itsZoomMax) { aMessageList.AddError("itsZoomMiniMap.itsZoomStartValue has to be between itsZoomMiniMap.itsZoomMin and itsZoomMiniMap.itsZoomMin"); } // zoom map PositiveError(ref aMessageList,"itsZoomMap.itsZoomChangeValue",itsDataModuleMinimap.itsZoomMap.itsZoomChangeValue); PositiveError(ref aMessageList,"itsZoomMap.itsZoomMax",itsDataModuleMinimap.itsZoomMap.itsZoomMax); PositiveError(ref aMessageList,"itsZoomMap.itsZoomMin",itsDataModuleMinimap.itsZoomMap.itsZoomMin); PositiveError(ref aMessageList,"itsZoomMap.itsZoomStartValue",itsDataModuleMinimap.itsZoomMap.itsZoomStartValue); if (itsDataModuleMinimap.itsZoomMap.itsZoomMin > itsDataModuleMinimap.itsZoomMap.itsZoomMax) { aMessageList.AddError("itsZoomMap.itsZoomMax must be bigger than itsZoomMap.itsZoomMin"); } if (itsDataModuleMinimap.itsZoomMap.itsZoomStartValue < itsDataModuleMinimap.itsZoomMap.itsZoomMin || itsDataModuleMinimap.itsZoomMap.itsZoomStartValue > itsDataModuleMinimap.itsZoomMap.itsZoomMax) { aMessageList.AddError("itsZoomMap.itsZoomStartValue has to be between itsZoomMap.itsZoomMin and itsZoomMap.itsZoomMin"); } // viewport if (itsDataModuleMinimap.itsViewport.itsActive && itsDataModuleMinimap.itsViewport.itsCamera == null) { aMessageList.AddError("Active viewport needs a camera (itsViewport.itsCamera)"); } if (itsDataModuleMinimap.itsViewport.itsActive && itsDataModuleMinimap.itsGlobalSettings.itsOrientation == KGFMapSystemOrientation.XYSideScroller) { aMessageList.AddError("Viewport display is not supported in SideScroller mode (itsViewport.itsCamera)"); } if (itsDataModuleMinimap.itsViewport.itsColor.a == 0) { aMessageList.AddError("Viewport will be invisible if itsColor.a == 0"); } // photo if (itsDataModuleMinimap.itsPhoto.itsTakePhoto && itsDataModuleMinimap.itsPhoto.itsPhotoLayers == 0) { aMessageList.AddError("itsPhoto.itsPhotoLayers has to contain some layers for the photo not to be empty"); } // user flags if (itsDataModuleMinimap.itsUserFlags.itsActive) { } // layer check if (LayerMask.NameToLayer(itsLayerName) < 0) { aMessageList.AddError(string.Format("The map system needs a layer with the name '{0}'",itsLayerName)); } // if (itsDataModuleMinimap.itsGlobalSettings.itsRenderLayers == 0) // { // aMessageList.AddError(string.Format("itsRenderLayer is not allowed to be Nothing")); // } // panning if (itsDataModuleMinimap.itsPanning.itsActive && itsDataModuleMinimap.itsPanning.itsUseBounds && itsDataModuleMinimap.itsPanning.itsBoundsLayers == 0) { aMessageList.AddError("itsPanning.itsBoundsLayers has to contain some layers for the panning bounds to work"); } if(itsDataModuleMinimap.itsShaders.itsShaderMapIcon == null) { aMessageList.AddError(string.Format("itsDataModuleMinimap.itsShaders.itsShaderMapIcon is null")); } if(itsDataModuleMinimap.itsShaders.itsShaderPhotoPlane == null) { aMessageList.AddError(string.Format("itsDataModuleMinimap.itsShaders.itsShaderPhotoPlane is null")); } if(itsDataModuleMinimap.itsShaders.itsShaderMapMask == null) { aMessageList.AddError(string.Format("itsDataModuleMinimap.itsShaders.itsShaderMapMask is null")); } if(itsDataModuleMinimap.itsFogOfWar.itsActive == true && itsDataModuleMinimap.itsShaders.itsShaderFogOfWar == null) { aMessageList.AddWarning(string.Format("itsDataModuleMinimap.itsShaders.itsShaderFogOfWar is null, fog of war will not work")); } // Transform aTransform = transform.Find("measure_cube"); // if(itsDataModuleMinimap.itsPhoto.itsTakePhoto == true && aTransform == null) // { // aMessageList.AddError(string.Format("please press the RecalcPhotoArea button")); // } return aMessageList; }
public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); if(itsDataMapIcon.itsCategory == string.Empty) { aMessageList.AddError("itsDataMapIcon.itsCategory is empty"); } if(itsDataMapIcon.itsTextureIcon == null) { aMessageList.AddError("itsDataMapIcon.itsTextureIcon is null"); } if(itsDataMapIcon.itsDepth < 0) { aMessageList.AddError("itsDataMapIcon.itsDepth must be > 0"); } return aMessageList; }
void RegionError(ref KGFMessageList theMessageList,string theName, float theValue,float theMin,float theMax) { if (theValue < theMin ||theValue > theMax) { theMessageList.AddError(string.Format("Value has to be between {0} and {1} ({2})",theMin,theMax,theName)); } }
/// <summary> /// Get errors /// </summary> /// <returns></returns> public KGFMessageList GetErrors() { KGFMessageList aMessageList = new KGFMessageList(); if (string.IsNullOrEmpty(itsMethodName)) { aMessageList.AddError("Empty method name"); } if (itsRuntimeObjectSearch) { if (string.IsNullOrEmpty(itsRuntimeObjectSearchType)) { aMessageList.AddError("Empty type field"); } } MethodInfo aFoundMethod; MonoBehaviour aFoundComponent; if (!FindMethod (this, out aFoundMethod, out aFoundComponent)) { aMessageList.AddError("Could not find method on object."); }else { ParameterInfo[] aParameterInfos = aFoundMethod.GetParameters(); for (int i=0;i<itsParameters.Length;i++) { if (!GetIsParameterLinked(i)) { if (typeof(UnityEngine.Object).IsAssignableFrom(aParameterInfos[i].ParameterType)) { if (itsParameters[i].itsValueUnityObject == null) { aMessageList.AddError("Empty unity object in parameters"); } } } } } return aMessageList; }
/// <summary> /// validate controls /// </summary> /// <param name="theControlAxis"></param> /// <returns></returns> public static KGFMessageList ValidateControls(control_axis[] theControlAxis, string theDebugPrefix) { KGFMessageList aMessageList = new KGFMessageList(); for(int i = 0; i< theControlAxis.Length; i++) { control_axis aControlAxis = theControlAxis[i]; if(aControlAxis.itsAxisSensitivity < 0) { aMessageList.AddError ("control axis sensitivity cannot be smaller than 0!"); } bool anException = false; try { Input.GetAxis(aControlAxis.itsAxisName); } catch(Exception theException) { Debug.LogError("KGFOrbitcamException: "+theException); anException = true; } if(anException) { aMessageList.AddError(theDebugPrefix+"["+i+"].itsAxisName: '"+aControlAxis.itsAxisName+"' is not defined in unity input settings"); } } return aMessageList; }
public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); //Orbiter if (itsOrbitCam.itsOrbitCam == null) { aMessageList.AddError("itsOrbitCam should not be empty"); } //Root if (itsTarget.itsTarget == null) { aMessageList.AddError("itsTarget should not be empty"); } if (itsTarget.itsTarget == this.gameObject) { aMessageList.AddError("itsTarget cannot be th KGFOrbitCamSetting itself"); } if (itsTarget.itsPositionSpeed <= 0) { aMessageList.AddError("itsLinkedTargetPositionSpeed has invalid value, has to be > 0"); } if (itsTarget.itsRotationSpeed <= 0) { aMessageList.AddError("itsLinkedTargetRotationSpeed has invalid value, has to be > 0"); } //Lookat if (itsLookat.itsLookatSpeed <= 0) { aMessageList.AddError("itsLookatSpeed has invalid value, has to be > 0"); } if (itsLookat.itsEnable) { if (itsLookat.itsLookatTarget == null) { aMessageList.AddError("itsLookat is Enabled but Lookat target has not been assigned"); } if (itsLookat.itsUpVectorSource == null) { aMessageList.AddError("itsLookat is Enabled but up vector source has not been assigned"); } } //Zoom if (itsZoom.itsZoomSpeed <= 0) { aMessageList.AddError("itsZoomSpeed has invalid value, has to be > 0"); } if (itsZoom.itsStartValue < itsZoom.itsMinLimit) { aMessageList.AddError("itsStartZoom should not be smaller than itsMinZoom"); } if (itsZoom.itsStartValue > itsZoom.itsMaxLimit) { aMessageList.AddError("itsStartZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMinLimit > itsZoom.itsMaxLimit) { aMessageList.AddError("itsMinZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMaxLimit < itsZoom.itsMinLimit) { aMessageList.AddError("itsMaxZoon should not be smaller than itsMinZoom"); } if (itsZoom.itsMinLimit < 0) { aMessageList.AddError("itsMinZoon should not be smaller than 0"); } //Rotation Up Down if (itsRotation.itsVertical.itsDownLimit < 0) { aMessageList.AddError("itsRotation itsUpDown itsDownLimit should not be smaller than 0"); } if (itsRotation.itsVertical.itsUpLimit < 0) { aMessageList.AddError("itsRotation itsUpDown itsUpLimit should not be smaller than 0"); } //Rotation Left Right if (itsRotation.itsHorizontal.itsLeftLimit < 0) { aMessageList.AddError("itsRotation itsLeftRight itsLeftLimit should not be smaller than 0"); } if (itsRotation.itsHorizontal.itsRightLimit < 0) { aMessageList.AddError("itsRotation itsLeftRight itsRightLimit should not be smaller than 0"); } aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsRotation.itsHorizontal.itsControls, "itsRotation.itsHorizontal.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsRotation.itsVertical.itsControls, "itsRotation.itsVertical.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsZoom.itsControls, "itsZoom.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsForwardBackward.itsControls, "itsPanning.itsForwardBackward.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsLeftRight.itsControls, "itsPanning.itsLeftRight.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsUpDown.itsControls, "itsPanning.itsUpDown.itsControls").GetAllMessagesArray()); return(aMessageList); }
public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList(); //Orbiter if (itsOrbitCam.itsOrbitCam == null) { aMessageList.AddError("itsOrbitCam should not be empty"); } //Root if (itsRoot.itsRoot == null) { aMessageList.AddError("itsRoot should not be empty"); } if (itsRoot.itsRoot == this.gameObject) { aMessageList.AddError("itsRoot cannot be th KGFOrbitCamSetting itself"); } if (itsRoot.itsLinkTargetPositionSpeed <= 0) { aMessageList.AddError("itsLinkedTargetPositionSpeed has invalid value, has to be > 0"); } if (itsRoot.itsLinkTargetRotationSpeed <= 0) { aMessageList.AddError("itsLinkedTargetRotationSpeed has invalid value, has to be > 0"); } //Lookat if (itsLookat.itsLookatSpeed <= 0) { aMessageList.AddError("itsLookatSpeed has invalid value, has to be > 0"); } if (itsLookat.itsEnable) { if (itsLookat.itsLookatTarget == null) { aMessageList.AddError("itsLookat is Enabled but Lookat target has not been assigned"); } if (itsLookat.itsUpVectorSource == null) { aMessageList.AddError("itsLookat is Enabled but up vector source has not been assigned"); } } //Zoom if (itsZoom.itsZoomSpeed <= 0) { aMessageList.AddError("itsZoomSpeed has invalid value, has to be > 0"); } if (itsZoom.itsStartZoom < itsZoom.itsMinZoom) { aMessageList.AddError("itsStartZoom should not be smaller than itsMinZoom"); } if (itsZoom.itsStartZoom > itsZoom.itsMaxZoom) { aMessageList.AddError("itsStartZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMinZoom > itsZoom.itsMaxZoom) { aMessageList.AddError("itsMinZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMaxZoom < itsZoom.itsMinZoom) { aMessageList.AddError("itsMaxZoon should not be smaller than itsMinZoom"); } if (itsZoom.itsMinZoom < 0) { aMessageList.AddError("itsMinZoon should not be smaller than 0"); } //Rotation Up Down if (itsRotation.itsUpDown.itsDownLimit < 0) { aMessageList.AddError("itsRotation itsUpDown itsDownLimit should not be smaller than 0"); } if (itsRotation.itsUpDown.itsUpLimit < 0) { aMessageList.AddError("itsRotation itsUpDown itsUpLimit should not be smaller than 0"); } //Rotation Left Right if (itsRotation.itsLeftRight.itsLeftLimit < 0) { aMessageList.AddError("itsRotation itsLeftRight itsLeftLimit should not be smaller than 0"); } if (itsRotation.itsLeftRight.itsRightLimit < 0) { aMessageList.AddError("itsRotation itsLeftRight itsRightLimit should not be smaller than 0"); } //Control if (itsInput.itsXAxisSensitivity < 0) { aMessageList.AddError("itsInput itsXAxisSensitivity should not be smaller than 0"); } if (itsInput.itsYAxisSensitivity < 0) { aMessageList.AddError("itsInput itsYAxisSensitivity should not be smaller than 0"); } if (itsInput.itsXAxisSensitivityTouch < 0) { aMessageList.AddError("itsInput itsXAxisSensitivityTouch should not be smaller than 0"); } if (itsInput.itsYAxisSensitivityTouch < 0) { aMessageList.AddError("itsInput itsYAxisSensitivityTouch should not be smaller than 0"); } if (itsInput.itsZoomAxisSensitivity < 0) { aMessageList.AddError("itsInput itsZoomAxisSensitivity should not be smaller than 0"); } return(aMessageList); }
/// <summary> /// Check this instance for errors /// </summary> /// <returns></returns> public override KGFMessageList Validate() { KGFMessageList aList = new KGFMessageList(); if (("" + itsEventData.itsMethodName).Trim() == string.Empty) { aList.AddError("itsMethod is empty"); } // find method if (!itsEventData.itsRuntimeObjectSearch) { if (itsEventData.itsObject == null) { aList.AddError("itsObject == null"); } if (("" + itsEventData.itsComponentName).Trim() == string.Empty) { aList.AddError("itsScript is empty"); } if (itsEventData.itsObject != null) { MethodInfo aFoundMethod; MonoBehaviour aFoundComponent; if (!FindMethod(itsEventData, out aFoundMethod, out aFoundComponent)) { aList.AddError("method could not be found"); } } } // search type if (itsEventData.itsRuntimeObjectSearch) { Type aType = itsEventData.GetRuntimeType(); if (aType == null) { aList.AddError("could not find type"); } else { if (aType.IsInterface) { aList.AddWarning("you used an interface, please ensure that the objects you want to call the method on are derrived from KGFObject"); } else { if (!typeof(MonoBehaviour).IsAssignableFrom(aType)) { aList.AddError("type must be derrived from Monobehaviour"); } if (!typeof(KGFObject).IsAssignableFrom(aType)) { aList.AddWarning("please derrive from KGFObject because it will be faster to search"); } } } } // // convert parameters // if (aFoundMethod != null) // { // object [] aParametersList = ConvertParameters (aFoundMethod.GetParameters (), itsParameters); // foreach (object anObject in aParametersList) // { // // Does not work, don't know why // if (anObject == null) // { // aList.AddError("null parameters are not allowed"); // break; // } // } // } return(aList); }
/// <summary> /// /// </summary> /// <returns></returns> public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList (); //target if (itsTarget.itsTarget == null) { aMessageList.AddError ("itsTarget should not be empty"); } if (itsTarget.itsPositionSpeed <= 0) { aMessageList.AddError ("itsLinkedTargetPositionSpeed has invalid value, has to be > 0"); } if (itsTarget.itsRotationSpeed <= 0) { aMessageList.AddError ("itsLinkedTargetRotationSpeed has invalid value, has to be > 0"); } //Zoom if (itsZoom.itsZoomSpeed <= 0) { aMessageList.AddError ("itsZoomSpeed has invalid value, has to be > 0"); } if (itsZoom.itsStartValue < itsZoom.itsMinLimit) { aMessageList.AddError ("itsStartZoom should not be smaller than itsMinZoom"); } if (itsZoom.itsStartValue > itsZoom.itsMaxLimit) { aMessageList.AddError ("itsStartZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMinLimit > itsZoom.itsMaxLimit) { aMessageList.AddError ("itsMinZoom should not be bigger than itsMaxZoom"); } if (itsZoom.itsMaxLimit < itsZoom.itsMinLimit) { aMessageList.AddError ("itsMaxZoom should not be smaller than itsMinZoom"); } if (itsZoom.itsMinLimit < 0) { aMessageList.AddError ("itsMinZoom should not be smaller than 0"); } //Rotation Up Down if (itsRotation.itsVertical.itsDownLimit < 0) { aMessageList.AddError ("itsRotation itsUpDown itsDownLimit should not be smaller than 0"); } if (itsRotation.itsVertical.itsUpLimit < 0) { aMessageList.AddError ("itsRotation itsUpDown itsUpLimit should not be smaller than 0"); } //Rotation Left Right if (itsRotation.itsHorizontal.itsLeftLimit < 0) { aMessageList.AddError ("itsRotation itsLeftRight itsLeftLimit should not be smaller than 0"); } if (itsRotation.itsHorizontal.itsRightLimit < 0) { aMessageList.AddError ("itsRotation itsLeftRight itsRightLimit should not be smaller than 0"); } //Lookat if (itsLookat.itsLookatSpeed <= 0) { aMessageList.AddError ("itsLookatSpeed has invalid value, has to be > 0"); } if (itsLookat.itsEnable) { if(itsLookat.itsLookatTarget == null) { aMessageList.AddError ("itsLookat is Enabled but Lookat target has not been assigned"); } if(itsLookat.itsUpVectorSource == null) { aMessageList.AddError ("itsLookat is Enabled but up vector source has not been assigned"); } } aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsRotation.itsHorizontal.itsControls,"itsRotation.itsHorizontal.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsRotation.itsVertical.itsControls,"itsRotation.itsVertical.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsZoom.itsControls,"itsZoom.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsForwardBackward.itsControls,"itsPanning.itsForwardBackward.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsLeftRight.itsControls,"itsPanning.itsLeftRight.itsControls").GetAllMessagesArray()); aMessageList.AddMessages(KGFOrbitCam.ValidateControls(itsPanning.itsUpDown.itsControls,"itsPanning.itsUpDown.itsControls").GetAllMessagesArray()); return aMessageList; }
/// <summary> /// /// </summary> /// <returns></returns> public KGFMessageList Validate() { KGFMessageList aMessageList = new KGFMessageList (); if (itsGlobalSettings.itsGeometry == null) { aMessageList.AddError ("its Geometry should nor be empty. Assign a character."); } if (itsGlobalSettings.itsMass <= 0) { aMessageList.AddError ("its Mass should be > 0."); } if (itsGlobalSettings.itsThickness <= 0) { aMessageList.AddError ("its Thickness should be > 0."); } if (itsGlobalSettings.itsHeight <= 0) { aMessageList.AddError ("its Height should be > 0."); } if(itsPointNavigationSettings.itsClickTargetRepesentationOK == null) { aMessageList.AddError ("itsClickTargetRepesentationOK should not be empty. Assign a projector"); } if(itsPointNavigationSettings.itsClickTargetRepesentationNotOK == null) { aMessageList.AddError ("itsClickTargetRepesentationNotOK should not be empty. Assign a projector"); } if(itsPointNavigationSettings.itsClickTargetRepesentationOKDouble == null) { aMessageList.AddError ("itsClickTargetRepesentationOKDouble should not be empty. Assign a projector"); } if(itsPointNavigationSettings.itsClickTargetRepesentationNotOKDouble == null) { aMessageList.AddError ("itsClickTargetRepesentationNotOKDouble should not be empty. Assign a projector"); } return aMessageList; }
/// <summary> /// Check this instance for errors /// </summary> /// <returns></returns> public override KGFMessageList Validate () { KGFMessageList aList = new KGFMessageList (); if (("" + itsEventData.itsMethodName).Trim () == string.Empty) { aList.AddError ("itsMethod is empty"); } // find method if (!itsEventData.itsRuntimeObjectSearch) { if (itsEventData.itsObject == null) { aList.AddError ("itsObject == null"); } if (("" + itsEventData.itsComponentName).Trim () == string.Empty) { aList.AddError ("itsScript is empty"); } if (itsEventData.itsObject != null) { MethodInfo aFoundMethod; MonoBehaviour aFoundComponent; if (!FindMethod (itsEventData, out aFoundMethod, out aFoundComponent)) { aList.AddError ("method could not be found"); } } } // search type if (itsEventData.itsRuntimeObjectSearch) { Type aType = itsEventData.GetRuntimeType(); if (aType == null) { aList.AddError("could not find type"); }else { if (aType.IsInterface) { aList.AddWarning("you used an interface, please ensure that the objects you want to call the method on are derrived from KGFObject"); } else { if (!typeof(MonoBehaviour).IsAssignableFrom(aType)) { aList.AddError("type must be derrived from Monobehaviour"); } if (!typeof(KGFObject).IsAssignableFrom(aType)) { aList.AddWarning("please derrive from KGFObject because it will be faster to search"); } } } } // // convert parameters // if (aFoundMethod != null) // { // object [] aParametersList = ConvertParameters (aFoundMethod.GetParameters (), itsParameters); // foreach (object anObject in aParametersList) // { // // Does not work, don't know why // if (anObject == null) // { // aList.AddError("null parameters are not allowed"); // break; // } // } // } return aList; }
void NullError(ref KGFMessageList theMessageList,string theName, object theValue) { if (theValue == null) { theMessageList.AddError(string.Format("value of '{0}' must not be null",theName)); } }