Example #1
0
    /// <summary>
    /// Render method for ingame. Waits for postrender.
    /// </summary>
    private IEnumerator OnPostRender()
    {
        if (itsPhotoData != null)
        {
            itsPhotoData.itsTexture.ReadPixels(new Rect(0, 0, itsPhotoData.itsTextureSize, itsPhotoData.itsTextureSize), 0, 0);
            itsPhotoData.itsTexture.wrapMode = TextureWrapMode.Clamp;
            itsPhotoData.itsTexture.Apply();

            itsOldPhotoData = itsPhotoData;
            // Get next frames data
            itsPhotoData = itsMapSystem.GetNextPhotoData();
            if (itsPhotoData != null)
            {
                transform.position = CalculateCameraPosition(itsPhotoData); //place camera correctly for photo
            }
            yield return(new WaitForEndOfFrame());                          //this is very important! When using pro reflective water effects you cannot simply create new MeshRenderers during rendering. So wait for end of frame.

            KGFMapSystem.KGFSetChildrenActiveRecursively(itsOldPhotoData.itsPhotoPlane, true);
        }
        if (itsPhotoData == null)
        {
            yield return(new WaitForEndOfFrame());

            itsDestroy = true;
        }
    }
Example #2
0
    private GameObject CreateRepresentation()
    {
        if (itsShaderMapIcon == null)
        {
            itsShaderMapIcon = Shader.Find("ColorTextureAlpha");
            if (itsShaderMapIcon == null)
            {
                LogError("Cannot find shader ColorTextureAlpha", typeof(KGFMapSystem).Name, this);
                return(null);
            }
        }
        if (itsDataMapIcon.itsTextureIcon == null)
        {
            LogError("itsDataMapIcon.itsTextureIcon is null", typeof(KGFMapSystem).Name, this);
            return(null);
        }

        if (itsShaderMapIcon != null & itsDataMapIcon.itsTextureIcon != null)
        {
            GameObject aGO = KGFMapSystem.GenerateTexturePlane(itsDataMapIcon.itsTextureIcon, itsShaderMapIcon);
            itsMaterial = aGO.GetComponent <Renderer>().sharedMaterial;
            return(aGO);
        }
        return(null);
    }
Example #3
0
	void OnMapSystemRegistered(object theSender, EventArgs theArgs)
	{
		KGFAccessor.KGFAccessorEventargs anArgs = (KGFAccessor.KGFAccessorEventargs)theArgs;
		itsMapSystem = (KGFMapSystem)anArgs.GetObject();
		itsMapSystem.EventFullscreenModeChanged += OnFullScreenModeChanged;
		
		UpdateNGUI();
	}
Example #4
0
 /// <summary>
 /// Set the use-arrow flag of this map icon
 /// </summary>
 /// <param name="theIsArrowUsed"></param>
 public void SetArrowUsage(bool theIsArrowUsed)
 {
     itsDataMapIcon.itsUseArrow = theIsArrowUsed;
     // update KGFMinimap module
     if (itsMapSystem == null)
     {
         itsMapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (itsMapSystem != null)
     {
         itsMapSystem.RefreshIconsVisibility();
     }
 }
Example #5
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
     }
     else
     {
         LogError("Could not find mapsystem object in scene");
     }
 }
Example #6
0
    /// <summary>
    /// Update the arrow icon of this map icon
    /// </summary>
    /// <param name="theTexture">The new texture to be used as arrow icon</param>
    public void SetTextureArrow(Texture2D theTexture)
    {
        itsDataMapIcon.itsTextureArrow = theTexture;

        // update KGFMinimap module
        if (itsMapSystem == null)
        {
            itsMapSystem = KGFAccessor.GetObject <KGFMapSystem>();
        }
        if (itsMapSystem != null)
        {
            itsMapSystem.UpdateIcon(this);
        }
    }
Example #7
0
    /// <summary>
    /// Setter for the color
    /// </summary>
    /// <param name="theColor"></param>
    public void SetColor(Color theColor)
    {
        itsDataMapIcon.itsColor = theColor;

        // update KGFMinimap module
        if (itsMapSystem == null)
        {
            itsMapSystem = KGFAccessor.GetObject <KGFMapSystem>();
        }
        if (itsMapSystem != null)
        {
            itsMapSystem.UpdateIcon(this);
        }
    }
Example #8
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
         MapSystem.EventMouseMapIconClicked += OnMapIconClick;
     }
     else
     {
         LogError("Please a add map icon to this action.");
     }
 }
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
			MapSystem.SetIconsVisibleByCategory(IconCategory.Value,ZoomValue.Value);
		}else
		{
			LogError("Could not find mapsystem object in scene");
		}
		Finish();
	}
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
			MapSystem.SetFullscreen(Visibility.Value);
		}else
		{
			LogError("Could not find mapsystem object in scene");
		}
		Finish();
	}
Example #11
0
    /// <summary>
    /// Change the visibility of the map icon
    /// </summary>
    /// <param name="theVisibility"></param>
    public void SetVisibility(bool theVisibility)
    {
        // change visibility
        itsMapIconIsVisible = theVisibility;

        // update KGFMinimap module
        if (itsMapSystem == null)
        {
            itsMapSystem = KGFAccessor.GetObject <KGFMapSystem>();
        }
        if (itsMapSystem != null)
        {
            itsMapSystem.RefreshIconsVisibility();
        }
    }
Example #12
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
         MapSystem.SetIconsVisibleByCategory(IconCategory.Value, ZoomValue.Value);
     }
     else
     {
         LogError("Could not find mapsystem object in scene");
     }
     Finish();
 }
Example #13
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
         MapSystem.SetFullscreen(Visibility.Value);
     }
     else
     {
         LogError("Could not find mapsystem object in scene");
     }
     Finish();
 }
Example #14
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
         MapSystem.SetMinimapEnabled(MinimapEnable.Value);
     }
     else
     {
         LogError("Could not find mapsystem object in scene");
     }
     Finish();
 }
    /// <summary>
    /// Update the style of the map system
    /// </summary>
    /// <param name="theIndex"></param>
    void UpdateStyle(int theIndex)
    {
        MapSystemStyle aStyle = itsStyles[theIndex];

        KGFMapSystem aMapSystem = KGFAccessor.GetObject <KGFMapSystem>();

        if (aMapSystem != null)
        {
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsBackground     = aStyle.itsBackgroundMap;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsBackground = aStyle.itsBackgroundMinimap;

            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsButton      = aStyle.itsButton;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsButtonHover = aStyle.itsButtonHover;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsButtonDown  = aStyle.itsButtonDown;

            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsButton      = aStyle.itsButton;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonHover = aStyle.itsButtonHover;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonDown  = aStyle.itsButtonDown;


            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomIn     = aStyle.itsButtonZoomIn;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomOut    = aStyle.itsButtonZoomOut;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsIconFullscreen = aStyle.itsButtonMap;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsIconZoomLock   = aStyle.itsButtonLock;
            aMapSystem.itsDataModuleMinimap.itsGlobalSettings.itsColorMap          = aStyle.itsColorMap;

            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsIconZoomIn     = aStyle.itsButtonZoomIn;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsIconZoomOut    = aStyle.itsButtonZoomOut;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsIconFullscreen = aStyle.itsButtonMap;
            aMapSystem.itsDataModuleMinimap.itsAppearanceMap.itsIconZoomLock   = aStyle.itsButtonLock;

            aMapSystem.SetMask(aStyle.itsMinimapMask, aStyle.itsMapMask);
            aMapSystem.itsDataModuleMinimap.itsAppearanceMiniMap.itsButtonPadding = aStyle.itsPaddingButtons;
            aMapSystem.itsDataModuleMinimap.itsGlobalSettings.itsColorAll         = aStyle.itsColorAll;

            aMapSystem.itsDataModuleMinimap.itsViewport.itsColor = aStyle.itsViewportColor;

            aMapSystem.itsDataModuleMinimap.itsToolTip.itsTextureBackground = aStyle.itsBackgroundTooltip;

            aMapSystem.UpdateStyles();
        }

//		itsGuiStyle = new GUIStyle();
//		itsGuiStyle.normal.background = aStyle.itsButton;
//		itsGuiStyle.hover.background = aStyle.itsButtonHover;
//		itsGuiStyle.active.background = aStyle.itsButtonDown;
    }
Example #16
0
	private Vector3 CalculateCameraPosition(KGFMapSystem.KGFPhotoData thePhotoData)
	{
		Vector3 aPlanePosition = thePhotoData.itsPosition;
		float aHalfPlaneSize = thePhotoData.itsMeters/2.0f;
		aPlanePosition.x += aHalfPlaneSize; //center camera above plane
		
		if(itsMapSystem.GetOrientation() == KGFMapSystem.KGFMapSystemOrientation.XZDefault)
		{
			aPlanePosition.z += aHalfPlaneSize; //center camera above plane
			aPlanePosition.y += GetComponent<Camera>().farClipPlane;
		}
		else
		{
			aPlanePosition.y += aHalfPlaneSize; //center camera above plane
			aPlanePosition.z -= GetComponent<Camera>().farClipPlane;
		}
		return aPlanePosition;
	}
Example #17
0
 void OnMapSystemRegistered(object theSender, EventArgs theArgs)
 {
     KGFAccessor.KGFAccessorEventargs anArgs = (KGFAccessor.KGFAccessorEventargs)theArgs;
     miniMap = (KGFMapSystem)anArgs.GetObject();
     //全屏变换
     miniMap.EventFullscreenModeChanged += OnFullscreenModeChanged;
     //鼠标进入小地图
     miniMap.EventMouseMapEntered += OnMouseMapEntered;
     //鼠标退出小地图
     miniMap.EventMouseMapLeft += OnMouseMapLeft;
     //鼠标点击小地图图标
     miniMap.EventMouseMapIconClicked += OnMouseMapIconClicked;
     //鼠标点击小地图
     miniMap.EventClickedOnMinimap += OnClickedOnMinimap;
     //在小地图创建标志
     miniMap.EventUserFlagCreated += OnUserFlagCreated;
     //标志状态改变
     miniMap.EventVisibilityOnMinimapChanged += OnVisibilityOnMinimapChanged;
 }
Example #18
0
    void Update()
    {
        if (itsDataMapIcon.itsRevealFogOfWar)
        {
            if (itsMapSystem == null)
            {
                itsMapSystem = KGFAccessor.GetObject <KGFMapSystem>();
            }
            if (itsMapSystem != null)
            {
                itsMapSystem.RevealFogOfWarAtPoint(itsTransformCache.position);
            }
        }

        if (itsDataMapIcon.itsBlinking)
        {
            float aBlinkValue = KGFUtility.PingPong(Time.time, 1, 0, 0, 0.6f);
            itsMaterial.color = new Color(itsDataMapIcon.itsColor.r, itsDataMapIcon.itsColor.g, itsDataMapIcon.itsColor.b, aBlinkValue);
        }
    }
Example #19
0
 void Update()
 {
     map    = GameObject.Find("MiniMap");
     button = GameObject.Find("BottomButton");
     if (map != null && button != null)
     {
         miniMap = map.GetComponent <KGFMapSystem>();
         miniMap.SetMinimapSize(0f);
         button.transform.localScale = new Vector3(0, 0, 0);
         if (slider.value == 1)
         {
             isLoading = false;
             button.transform.localScale = new Vector3(1, 1, 1);
             miniMap.SetMinimapSize(0.25f);
         }
         else
         {
             isLoading = true;
         }
     }
 }
Example #20
0
 public override void OnEnter()
 {
     if (MapSystem == null)
     {
         MapSystem = KGFAccessor.GetObject <KGFMapSystem>();
     }
     if (MapSystem != null)
     {
         if (MapSystem.GetIsVisibleOnMap(MapIcon) == Visibility.Value)
         {
             Finish();
         }
         else
         {
             MapSystem.EventVisibilityOnMinimapChanged += OnVisibilityChanged;
         }
     }
     else
     {
         LogError("Please a add map icon to this action.");
     }
 }
Example #21
0
    private GameObject CreateRepresentation()
    {
        if (itsShaderMapIcon == null)
        {
            itsShaderMapIcon = Shader.Find("ColorTextureAlpha");
            if (itsShaderMapIcon == null)
            {
                LogError("Cannot find shader ColorTextureAlpha", typeof(KGFMapSystem).Name, this);
                return(null);
            }
        }
        if (itsDataMapIcon.itsTextureIcon == null)
        {
            LogError("itsDataMapIcon.itsTextureIcon is null", typeof(KGFMapSystem).Name, this);
            return(null);
        }

        if (itsShaderMapIcon != null & itsDataMapIcon.itsTextureIcon != null)
        {
            return(KGFMapSystem.GenerateTexturePlane(itsDataMapIcon.itsTextureIcon, itsShaderMapIcon));
        }
        return(null);
    }
Example #22
0
 public override void Reset()
 {
     MapSystem = null;
     ViewPort  = 10;
 }
Example #23
0
	void RemoveClickMarker(KGFMapSystem.mapicon_listitem_script theMapIcon)
	{
		GameObject.Destroy(((MonoBehaviour)theMapIcon.itsMapIcon).gameObject);
	}
Example #24
0
	/// <summary>
	/// Set the use-arrow flag of this map icon
	/// </summary>
	/// <param name="theIsArrowUsed"></param>
	public void SetArrowUsage(bool theIsArrowUsed)
	{
		itsDataMapIcon.itsUseArrow = theIsArrowUsed;
		// update KGFMinimap module
		if (itsMapSystem == null)
		{
			itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (itsMapSystem != null)
		{
			itsMapSystem.RefreshIconsVisibility();
		}
	}
	public void OnEnable ()
	{
		itsTarget = (KGFMapSystem)target;
	}
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
			if (MapSystem.GetIsVisibleOnMap(MapIcon) == Visibility.Value)
			{
				Finish();
			}else
			{
				MapSystem.EventVisibilityOnMinimapChanged += OnVisibilityChanged;
			}
		}else
		{
			LogError("Please a add map icon to this action.");
		}
	}
Example #27
0
	/// <summary>
	/// Setter for the color
	/// </summary>
	/// <param name="theColor"></param>
	public void SetColor(Color theColor)
	{
		itsDataMapIcon.itsColor = theColor;
		
		// update KGFMinimap module
		if (itsMapSystem == null)
		{
			itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (itsMapSystem != null)
		{
			itsMapSystem.UpdateIcon(this);
		}
	}
	void Start()
	{
		itsMapSystem = GetComponent<KGFMapSystem>();								//get the mapsystem only once and cache it
		itsMapSystem.EventClickedOnMinimap += OnUserClickedOnMap;					//register OnClick method
		itsMapSystem.EventUserFlagCreated += OnUserFlagWasCreated;					//register OnFlagSet method
	}
	public override void Reset ()
	{
		MapSystem = null;
		ViewPort = 10;
	}
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
			MapSystem.SetMinimapEnabled(MinimapEnable.Value);
		}else
		{
			LogError("Could not find mapsystem object in scene");
		}
		Finish();
	}
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
		}else
		{
			LogError("Could not find mapsystem object in scene");
		}
	}
	void Start()
	{
		itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		itsMapSystem.EventFullscreenModeChanged += OnFullScreenModeChanged;
	}
	public override void OnEnter ()
	{
		if(MapSystem == null)
		{
			MapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (MapSystem != null)
		{
			MapSystem.EventMouseMapIconClicked += OnMapIconClick;
		}else
		{
			LogError("Please a add map icon to this action.");
		}
	}
Example #34
0
	/// <summary>
	/// Update the arrow icon of this map icon
	/// </summary>
	/// <param name="theTexture">The new texture to be used as arrow icon</param>
	public void SetTextureArrow(Texture2D theTexture)
	{
		itsDataMapIcon.itsTextureArrow = theTexture;
		
		// update KGFMinimap module
		if (itsMapSystem == null)
		{
			itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (itsMapSystem != null)
		{
			itsMapSystem.UpdateIcon(this);
		}
	}
Example #35
0
	/// <summary>
	/// Change the visibility of the map icon
	/// </summary>
	/// <param name="theVisibility"></param>
	public void SetVisibility(bool theVisibility)
	{
		// change visibility
		itsMapIconIsVisible = theVisibility;
		
		// update KGFMinimap module
		if (itsMapSystem == null)
		{
			itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
		}
		if (itsMapSystem != null)
		{
			itsMapSystem.RefreshIconsVisibility();
		}
	}
Example #36
0
    public void FightClicked()
    {
        GameObject.Find("CF-Complete-Physics-Platformer").GetComponent <TouchController>().b = true;
        GameObject.Find("CF-Complete-Physics-Platformer").GetComponent <TouchController>().a = true;
        tape                  = GameObject.Find("Tape1").GetComponent <Image>();
        tape.enabled          = false;
        round                 = GameObject.Find("Round").GetComponent <Text>();
        round.enabled         = false;
        waveText              = GameObject.Find("WaveText").GetComponent <Text>();
        waveText.enabled      = false;
        scoreText             = GameObject.Find("ScoreText").GetComponent <Text>();
        scoreText.enabled     = false;
        scorePoints           = GameObject.Find("ScorePoints").GetComponent <Text>();
        scorePoints.enabled   = false;
        moneyText             = GameObject.Find("MoneyText").GetComponent <Text>();
        moneyText.enabled     = false;
        moneyPoints           = GameObject.Find("MoneyPoints").GetComponent <Text>();
        moneyPoints.enabled   = false;
        minimapCamera         = GameObject.Find("camera_minimap").GetComponent <Camera>();
        minimapCamera.enabled = false;
        minimap               = GameObject.Find("KGFMapSystem").GetComponent <KGFMapSystem>();
        minimap.itsDataModuleMinimap.itsGlobalSettings.itsHideGUI = true;
        fightClicked = true;
        fightButton.SetActive(false);
        if (king)
        {
            stop = true;
            Stop();
            moveIt = true;
            animator.SetTrigger("FinalBattle");
            animator.SetBool("finalBattle", true);
            king = false;
        }

        if (punk)
        {
            stop = true;
            Stop();
            moveIt = true;
            animator.SetTrigger("PunkBossSpawn");
            animator.SetBool("punkBossSpawn", true);
            punk = false;
        }

        if (dino)
        {
            stop = true;
            Stop();
            moveIt = true;
            animator.SetTrigger("DinoBossSpawn");
            animator.SetBool("dinoBossSpawn", true);
            dino = false;
        }

        if (mach)
        {
            stop = true;
            Stop();
            moveIt = true;
            animator.SetTrigger("MachineBossSpawn");
            animator.SetBool("machineBossSpawn", true);
            mach = false;
        }

        if (ship)
        {
            stop = true;
            Stop();
            moveIt = true;
            shp    = true;
            animator.SetTrigger("AlienBossSpawn");
            animator.SetBool("alienBossSpawn", true);
            ship = false;
        }
    }
Example #37
0
 void Start()
 {
     miniMap = GameObject.Find("MiniMap").GetComponent <KGFMapSystem>();
     KGFAccessor.GetExternal <KGFMapSystem>(OnMapSystemRegistered);
 }
Example #38
0
	void Update()
	{
		if (itsDataMapIcon.itsRevealFogOfWar)
		{
			if (itsMapSystem == null)
			{
				itsMapSystem = KGFAccessor.GetObject<KGFMapSystem>();
			}
			if (itsMapSystem != null)
			{
				itsMapSystem.RevealFogOfWarAtPoint(itsTransformCache.position);
			}
		}
		
		if (itsDataMapIcon.itsBlinking)
		{
			float aBlinkValue = KGFUtility.PingPong(Time.time,1,0,0,0.6f);
			itsMaterial.color = new Color(itsDataMapIcon.itsColor.r,itsDataMapIcon.itsColor.g,itsDataMapIcon.itsColor.b,aBlinkValue);
		}
	}
Example #39
0
 public override void Reset()
 {
     MapSystem = null;
 }
	public override void Reset ()
	{
		MapSystem = null;
	}
Example #41
0
 void Start()
 {
     itsMapSystem = GetComponent <KGFMapSystem>();                                                           //get the mapsystem only once and cache it
     itsMapSystem.EventClickedOnMinimap += OnUserClickedOnMap;                                               //register OnClick method
     itsMapSystem.EventUserFlagCreated  += OnUserFlagWasCreated;                                             //register OnFlagSet method
 }
 public void OnEnable()
 {
     itsTarget = (KGFMapSystem)target;
 }