public void Hide() { BETween.anchoredPosition(rtDialog.gameObject, 0.3f, new Vector3(0, -500)).method = BETweenMethod.easeOut; BETween.alpha(gameObject, 0.3f, 0.5f, 0.0f).method = BETweenMethod.easeOut; BETween.enable(gameObject, 0.01f, false).delay = 0.4f; //gameObject.SetActive(false); SceneTown.isModalShow = false; }
public void _Hide() { Time.timeScale = 1; BETween.scale(Dialog.gameObject, 0.2f, new Vector3(1, 1, 1), new Vector3(1.3f, 1.3f, 1.3f)).method = BETweenMethod.easeOut; BETween.alpha(Dialog.gameObject, 0.2f, 1.0f, 0.0f).method = BETweenMethod.easeOut; BETween.alpha(gameObject, 0.2f, 0.5f, 0.0f).method = BETweenMethod.easeOut; BETween.enable(gameObject, 0.01f, false).delay = 0.3f; //gameObject.SetActive(false); if (SetModal) { SceneTown.isModalShow = false; } }
// collect resources public void Collect() { string textColor = ""; // increase resource count if (def.eProductionType == PayType.Elixir) { SceneTown.Elixir.ChangeDelta((double)Production); SceneTown.instance.CapacityCheck(); textColor = "<color=purple>"; } else if (def.eProductionType == PayType.Gold) { SceneTown.Gold.ChangeDelta((double)Production); SceneTown.instance.CapacityCheck(); textColor = "<color=orange>"; } else { } // show collect ui to show how many resources was collected UICollect script = UIInGame.instance.AddInGameUI(prefUICollect, transform, new Vector3(0, 1.5f, 0)).GetComponent <UICollect>(); script.Name.text = textColor + ((int)Production).ToString() + "</color>"; script.Init(transform, new Vector3(0, 1.0f, 0)); // reset values related to production Collectable = false; Production = 0; // hide collect dialog BETween.alpha(uiInfo.groupCollect.gameObject, 0.3f, 1.0f, 0.0f); BETween.enable(uiInfo.groupCollect.gameObject, 0.3f, true, false); // save game - save game when action is occured. not program quit moment SceneTown.instance.Save(); }
public void Land(bool landed, bool animate) { if (Landed == landed) { return; } if (landed && !Landable) { if (((int)tilePosOld.x == -1) && ((int)tilePosOld.y == -1)) { return; } tilePos = tilePosOld; //Debug.Log ("Land RecoverOldPos: "+TilePosOldX.ToString()+","+TilePosOldY.ToString()); ground.Move(gameObject, tilePos, tileSize); CheckLandable(); if (!Landable) { return; } } Landed = landed; ground.OccupySet(this); if (!Landed) { tilePosOld = tilePos; //Debug.Log ("Land Save OldPos: "+TilePosOldX.ToString()+","+TilePosOldY.ToString()); } else { if (!OnceLanded) { OnceLanded = true; } } CheckLandable(); goGrid.SetActive(Landed ? false : true); if (goArrowRoot != null) { goArrowRoot.SetActive(Landed ? false : true); } if (uiInfo != null) { //uiInfo.groupProgress.alpha = 0; if (animate) { if (Landed) { BETween.alpha(uiInfo.groupInfo.gameObject, 0.1f, 1.0f, 0.0f); BETween.enable(uiInfo.groupInfo.gameObject, 0.1f, true, false); } else { BETween.alpha(uiInfo.groupInfo.gameObject, 0.1f, 0.0f, 1.0f); uiInfo.groupInfo.gameObject.SetActive(true); } } else { uiInfo.groupInfo.alpha = Landed ? 0 : 1; uiInfo.groupInfo.gameObject.SetActive(Landed ? false : true); } } // if building is wall, check neighbor if (Type == 2) { CheckNeighbor(); } if (Landed && (goCenter != null)) { SceneTown.instance.Save(); BEUtil.SetObjectColor(goCenter, Color.white); BEUtil.SetObjectColor(goXInc, Color.white); BEUtil.SetObjectColor(goZInc, Color.white); } UpjustYByState(); if (!SceneTown.instance.InLoading && (BEWorkerManager.instance != null)) { BEWorkerManager.instance.OnTileInfoChanged(); } }