Esempio n. 1
0
    public KGFMessageList Validate()
    {
        KGFMessageList aList = new KGFMessageList();

        if (itsCamera == null)
        {
            aList.AddError("KGFCutscene can only be used in combination with a camera");
        }

        return(aList);
    }
Esempio n. 2
0
    public KGFMessageList Validate()
    {
        KGFMessageList aList = new KGFMessageList();

        if (itsCamera == null)
        {
            aList.AddError("KGFCutscene can only be used in combination with a camera");
        }

        return aList;
    }
Esempio n. 3
0
    public override KGFMessageList Validate()
    {
        KGFMessageList aMessageList = new KGFMessageList();

        if (itsDataModuleDebugger.itsIconModule == null)
        {
            aMessageList.AddWarning("the module icon is missing");
        }

        return(aMessageList);
    }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
    public override KGFMessageList Validate()
    {
        KGFMessageList aMessageList = new KGFMessageList();

        if (itsDataModuleCustomGUI.itsUnknownIcon == null)
        {
            aMessageList.AddWarning("the unknown icon is missing");
        }

        if (itsDataModuleCustomGUI.itsModifierKey == itsDataModuleCustomGUI.itsSchortcutKey)
        {
            aMessageList.AddInfo("the modifier key is equal to the shortcut key");
        }

        return(aMessageList);
    }
Esempio n. 6
0
        /// <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);
    }
    /// <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);
    }
Esempio n. 9
0
    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);
    }
Esempio n. 10
0
    /// <summary>
    /// this class will call the validate method of the inspector
    /// </summary>
    /// <param name="theGameObject"></param>
    public static KGFMessageList ValidateEditor(UnityEngine.Object theObject)
    {
        KGFMessageList aMessageList = new KGFMessageList();
        string         anObjectName = theObject.GetType().ToString();
        string         aTypeName    = anObjectName + "Editor";
        Type           aType        = Type.GetType(aTypeName);

        if (aType != null)
        {
            MethodInfo aMethodInfo = aType.GetMethod("Validate" + aTypeName, System.Reflection.BindingFlags.Static | BindingFlags.Public);
            if (aMethodInfo != null && aMethodInfo.GetParameters().Length == 1)
            {
                object[] aParameters = new object[1];
                aParameters[0] = theObject;
                aMessageList   = (KGFMessageList)aMethodInfo.Invoke(null, aParameters);
            }
            else
            {
                if (!itsAlreadySentWarnings.Contains(aTypeName))
                {
                    itsAlreadySentWarnings.Add(aTypeName);
                    aMessageList.AddWarning("static method Validate" + aTypeName + "() not implemented in: " + aTypeName);
                    Debug.LogWarning("static method Validate() not implemented in: " + aTypeName);
                }
            }
        }
        else
        {
            if (!itsAlreadySentWarnings.Contains(aTypeName))
            {
                itsAlreadySentWarnings.Add(aTypeName);
                aMessageList.AddWarning("type: " + aTypeName + " not implemented.");
                Debug.LogWarning("type: " + aTypeName + " not implemented.");
            }
        }
        return(aMessageList);
    }
Esempio n. 11
0
	/// <summary>
	/// this class will call the validate method of the inspector
	/// </summary>
	/// <param name="theGameObject"></param>
	public static KGFMessageList ValidateEditor(UnityEngine.Object theObject)
	{
		KGFMessageList aMessageList = new KGFMessageList();
		string anObjectName = theObject.GetType().ToString();
		string aTypeName = anObjectName+"Editor";
		Type aType = Type.GetType(aTypeName);
		if(aType != null)
		{
			MethodInfo aMethodInfo = aType.GetMethod("Validate"+aTypeName,System.Reflection.BindingFlags.Static | BindingFlags.Public);
			if(aMethodInfo != null && aMethodInfo.GetParameters().Length == 1)
			{
				object[] aParameters = new object[1];
				aParameters[0] = theObject;
				aMessageList = (KGFMessageList)aMethodInfo.Invoke(null,aParameters);
			}
			else
			{
				if (!itsAlreadySentWarnings.Contains(aTypeName))
				{
					itsAlreadySentWarnings.Add(aTypeName);
					aMessageList.AddWarning("static method Validate"+aTypeName+"() not implemented in: "+aTypeName);
					Debug.LogWarning("static method Validate() not implemented in: "+aTypeName);
				}
			}
		}
		else
		{
			if (!itsAlreadySentWarnings.Contains(aTypeName))
			{
				itsAlreadySentWarnings.Add(aTypeName);
				aMessageList.AddWarning("type: "+aTypeName+" not implemented.");
				Debug.LogWarning("type: "+aTypeName+" not implemented.");
			}
		}
		return aMessageList;
	}
Esempio n. 12
0
	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;
	}
Esempio n. 13
0
	void PositiveError(ref KGFMessageList theMessageList,string theName, float theValue)
	{
		if (theValue < 0)
		{
			theMessageList.AddError(string.Format("{0} must be positive",theName));
		}
	}
Esempio n. 14
0
	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));
		}
	}
Esempio n. 15
0
	void NullError(ref KGFMessageList theMessageList,string theName, object theValue)
	{
		if (theValue == null)
		{
			theMessageList.AddError(string.Format("value of '{0}' must not be null",theName));
		}
	}
    public static KGFMessageList ValidateKGFOrbitCamSettingsEditor(UnityEngine.Object theTarget)
    {
        KGFMessageList aMessageList = KGFEditor.ValidateKGFEditor(theTarget);

        return(aMessageList);
    }
Esempio n. 17
0
    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);
    }
    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);
    }
Esempio n. 19
0
    public static KGFMessageList ValidateKGFEditor(UnityEngine.Object theTarget)
    {
        KGFMessageList aMessageList = new KGFMessageList();

        return(aMessageList);
    }
Esempio n. 20
0
    /// <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);
    }
    public virtual KGFMessageList Validate()
    {
        KGFMessageList aMessageList = new KGFMessageList();

        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;
	}
Esempio n. 23
0
	public override KGFMessageList Validate()
	{
		KGFMessageList aMessageList = new KGFMessageList();
		
		if(itsDataModuleCustomGUI.itsUnknownIcon == null)
		{
			aMessageList.AddWarning("the unknown icon is missing");
		}
		
		if(itsDataModuleCustomGUI.itsModifierKey == itsDataModuleCustomGUI.itsSchortcutKey)
		{
			aMessageList.AddInfo("the modifier key is equal to the shortcut key");
		}
		
		return aMessageList;
	}
Esempio n. 24
0
    /// <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;
    }
Esempio n. 25
0
	public virtual KGFMessageList Validate()
	{
		KGFMessageList aMessageList = new KGFMessageList();
		return aMessageList;
	}
    /// <summary>
    /// renders a section for found errors in the inspector
    /// </summary>
    /// <param name="theTarget">the currently displayed data object</param>
    public static void RenderInspectorErrorChecking(KGFMessageList theMessageList)
    {
//		KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxMiddleVertical, GUILayout.ExpandWidth(true));
        {
            if (theMessageList != null)
            {
                // render infos
                bool aShowOK = true;

                KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxInvisible, GUILayout.ExpandWidth(true));
                {
                    #region render info

                    /*
                     * string[] aInfoList = aMessageList.GetInfoArray();
                     *
                     * if (aInfoList.Length > 0)
                     * {
                     *      aShowOK = false;
                     *
                     *      foreach (string aMessage in aInfoList)
                     *      {
                     *              RenderWarning(aMessage);
                     *      }
                     * }
                     */

                    #endregion

                    #region render errors
                    string[] anErrorList = theMessageList.GetErrorArray();
                    if (anErrorList.Length > 0)
                    {
                        aShowOK = false;

                        foreach (string aMessage in anErrorList)
                        {
                            RenderError(aMessage);
                        }
                    }
                    #endregion

                    #region render warnings
                    anErrorList = theMessageList.GetWarningArray();
                    if (anErrorList.Length > 0)
                    {
                        aShowOK = false;
                        foreach (string aMessage in anErrorList)
                        {
                            RenderWarning(aMessage);
                        }
                    }
                    #endregion

                    if (aShowOK)
                    {
                        RenderOK();
                    }
                }
                KGFGUIUtility.EndVerticalBox();
            }
            else
            {
                RenderError("the module doesn`t implement the KGFIValidator interface");
            }
        }
//		KGFGUIUtility.EndVerticalBox();
    }
Esempio n. 27
0
    /// <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;
    }
Esempio n. 28
0
    public static KGFMessageList ValidateKGFCustomGUIEditor(UnityEngine.Object theTarget)
    {
        KGFMessageList aMessageList = KGFEditor.ValidateKGFEditor(theTarget);

        return(aMessageList);
    }
Esempio n. 29
0
		/// <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;
		}
Esempio n. 30
0
	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;
	}
    /// <summary>
    /// renders the default Kolmich game framework inspector window (TitleBar, Default Unity Inspector, Infobox, Buttons)
    /// </summary>
    /// <param name="theEditor">
    ///     <see cref="System.String"/>
    /// </param>
    public static void RenderKGFInspector(KGFEditor theEditor, Type theType, Action theHandler)
    {
//		// use fixed skin
//		KGFGUIUtility.SetSkinPath("KGFSkins/default/skins/skin_default_16");

        #region icon loading
        if (itsIconHelp == null)
        {
            itsIconHelp = Resources.Load("KGFCore/textures/help") as Texture2D;
        }

        if (itsIconInfo == null)
        {
            itsIconInfo = Resources.Load("KGFCore/textures/info") as Texture2D;
        }

        if (itsIconWarning == null)
        {
            itsIconWarning = Resources.Load("KGFCore/textures/warning") as Texture2D;
        }

        if (itsIconError == null)
        {
            itsIconError = Resources.Load("KGFCore/textures/error") as Texture2D;
        }

        if (itsIconOK == null)
        {
            itsIconOK = Resources.Load("KGFCore/textures/ok") as Texture2D;
        }
        #endregion

        //set the look to Unity default
        EditorGUIUtility.LookLikeControls();

        KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxDecorated, GUILayout.ExpandHeight(false), GUILayout.ExpandWidth(true));
        {
            //render the title of the Inspector
            RenderTitle(theEditor.target);

            //render the path and the reference id
            RenderPath(theEditor);

            KGFGUIUtility.BeginVerticalBox(KGFGUIUtility.eStyleBox.eBoxMiddleVertical);
            {
                KGFGUIUtility.BeginHorizontalPadding();
                {
//					DrawCustomInspector(theEditor);
//					DrawCustomInspectorReflection(theEditor.target,theEditor.target,0);
                    theEditor.DrawDefaultInspector();
                    if (theHandler != null)
                    {
                        theHandler();
                    }
                }
                KGFGUIUtility.EndHorizontalPadding();
            }
            KGFGUIUtility.EndVerticalBox();

            // check if the object is a prefab
            PrefabType aPrefabType = PrefabUtility.GetPrefabType(theEditor.target);
            bool       theIsPrefab = !(aPrefabType == PrefabType.PrefabInstance || aPrefabType == PrefabType.None || aPrefabType == PrefabType.DisconnectedPrefabInstance);

            // draw custom inspector gui
            RenderObjectCustomGui(theEditor.target, theIsPrefab);

            // draw error checking gui
            KGFIValidator aValidator = theEditor.target as KGFIValidator;
            if (aValidator == null)
            {
                KGFMessageList aMessageList = new KGFMessageList();
                aMessageList.AddWarning("Cannot validate: " + theEditor.target.name + " cause it is does not implemet a KGFIValidator");
                RenderInspectorErrorChecking(aMessageList);
            }
            else
            {
                KGFMessageList anEditorMessageList = KGFEditor.ValidateEditor(theEditor.target);
                KGFMessageList aTotalMessageList   = aValidator.Validate();
                aTotalMessageList.AddMessages(anEditorMessageList.GetAllMessagesArray());

                RenderInspectorErrorChecking(aTotalMessageList);
            }

            // help button
            KGFGUIUtility.BeginHorizontalBox(KGFGUIUtility.eStyleBox.eBoxDarkBottom);
            {
                if (KGFGUIUtility.Button(itsIconHelp, "documentation", KGFGUIUtility.eStyleButton.eButton, GUILayout.ExpandWidth(true)))
                {
                    Application.OpenURL("http://www.kolmich.at/documentation/");
                }

                if (KGFGUIUtility.Button(itsIconHelp, "forum", KGFGUIUtility.eStyleButton.eButton, GUILayout.ExpandWidth(true)))
                {
                    Application.OpenURL("http://www.kolmich.at/forum");
                }

                if (KGFGUIUtility.Button(itsIconHelp, "homepage", KGFGUIUtility.eStyleButton.eButton, GUILayout.ExpandWidth(true)))
                {
                    Application.OpenURL("http://www.kolmich.at/");
                }
            }
            KGFGUIUtility.EndHorizontalBox();
        }
        KGFGUIUtility.EndVerticalBox();
    }
Esempio n. 32
0
	public static KGFMessageList ValidateKGFEditor(UnityEngine.Object theTarget)
	{
		KGFMessageList aMessageList = new KGFMessageList();
		return aMessageList;
	}
Esempio n. 33
0
	/// <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 ();

        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;
    }