private void PauseRegister() { TargetGo.SetActive(false); RegisterViewTweener = DotweenManager.DOLocalMoveY(lv.RegisterView).SetAutoKill(false); //确保此方法只运行一次 EnterGameTweener.onPause -= PauseRegister; }
private void Pause() { TargetGo.SetActive(false); ChangePWViewTweener = DotweenManager.DOLocalMoveY(lv.ChangePWView).SetAutoKill(false); //确保此方法只运行一次 EnterGameTweener.onPause -= Pause; }
//购买成功回调 private bool OnBuySucc(int eventId, object arg) { BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(ID); Name.text = ba.Name; Price.text = ba.Price.ToString(); if (ba.Type == ObjectType.Seed) { Time.text = "成长周期: " + ba.GrothTime / 3600 + "h"; } else { Time.text = ""; } Sprite sp = SpritesManager.Instance.GetSprite(ID); _Image.rectTransform.sizeDelta = new Vector2(100, 100); //_Image.rectTransform.sizeDelta = new Vector2(sp.rect.width, sp.rect.height); _Image.sprite = sp; _Image.color = Color.white; TargetGo.SetActive(true); MusicManager.Instance.Playsfx(AudioNames.GetMoney); return(true); }
public override void OnOpen() { base.OnOpen(); CountInput.text = "0"; TargetGo.SetActive(false); StoreController.Instance.GetDispatcher().AddListener(StoreEvent.OnStoreUnits, InitSFc); }
public override void OnOpen() { base.OnOpen(); TargetGo.SetActive(false); ShopController.Instance.GetDispatcher().AddListener(ShopEvent.OnSelectShopItem, OnSelectShopItem); ShopController.Instance.GetDispatcher().AddListener(ShopEvent.OnBuying, OnBuying); }
//点击关闭按钮 private void OnClickCloseBtn() { MusicManager.Instance.Playsfx(AudioNames.CloseBtn); StoreController.Instance.currentSellID = 0; StoreController.Instance.currentSellNumber = 0; TargetGo.SetActive(false); }
private bool ShowSystemMsg(int eventId, object arg) { string content = (string)arg; Content.text = content; TargetGo.SetActive(true); return(false); }
public HitCircle(GameView inTarget, float inRadius, float inMass, bool inIsKinematic = false, bool inIsTrigger = false) : base(inTarget, inMass, inIsKinematic) { var circle = TargetGo.AddComponent <CircleCollider2D>(); circle.isTrigger = inIsTrigger; Collider = circle; Radius = inRadius; }
public HitBox(GameView inTarget, Vector2 inSize, float inMass, bool inIsKinematic = false, bool inIsTrigger = false) : base(inTarget, inMass, inIsKinematic) { var box = TargetGo.AddComponent <BoxCollider2D>(); box.isTrigger = inIsTrigger; Collider = box; size = inSize; }
//打开chatview private bool OnOpenChatView(int eventId, object arg) { bool isChating = (bool)arg; TargetGo.SetActive(isChating); if (TargetGo.activeInHierarchy) { OnReviceLog(0, null); } return(false); }
public override void BuildUIContent() { base.BuildUIContent(); CloseBtn = TargetGo.transform.Find("CloseBtn").GetComponent <Button>(); CloseBtn.onClick.AddListener(OnClickCloseBtn); GetMoney = TargetGo.transform.Find("Money").GetComponent <Text>(); SellContent = TargetGo.transform.Find("SellContent").GetComponent <Text>(); TargetGo.SetActive(false); }
public GameCollider(GameView inTarget, float inMass, bool inIsKinematic) : base(inTarget) { TargetGo = inTarget.gameObject; // -------------------------------------------------------------------------------- // Add & Setup RigidBody2d // -------------------------------------------------------------------------------- RigidBody = TargetGo.AddComponent <Rigidbody2D>(); RigidBody.isKinematic = inIsKinematic; RigidBody.mass = inMass; RigidBody.constraints = RigidbodyConstraints2D.FreezeRotation; RigidBody.gravityScale = SystemFacade.Parameters.gravityScale; RigidBody.collisionDetectionMode = CollisionDetectionMode2D.Continuous; SystemFacade.Physics.AddComponent(this); //subscribe the collider // -------------------------------------------------------------------------------- // Initialize private variables // -------------------------------------------------------------------------------- lastCollision = null; isCollide = false; colliderBuffer = new Collider2D[5]; isRun = true; }
private bool OnSellSucc(int eventId, object arg) { int itemId = StoreController.Instance.currentSellID; int count = StoreController.Instance.currentSellNumber; string type = ""; BaseAtrribute ba = LoadObjctDateConfig.Instance.GetAtrribute(itemId); switch (ba.Type) { case ObjectType.Seed: type = "种子"; break; case ObjectType.Result: type = "果实"; break; case ObjectType.PrimaryOil: case ObjectType.SeniorOil: type = "精油"; break; case ObjectType.Fertilizer: type = "肥料"; break; default: Debug.Log("卖出物体类型错误"); break; } GetMoney.text = (count * ba.Price).ToString(); SellContent.text = "[出售" + count + "份" + type + "]"; TargetGo.SetActive(true); MusicManager.Instance.Playsfx(AudioNames.GetMoney); return(false); }
//该窗口的隐藏于显示 private void WindowShowOrHide(bool isOpen) { Introduce_Scroll.verticalNormalizedPosition = 1; TargetGo.SetActive(isOpen); }
private void OnClickCloseBtn() { TargetGo.SetActive(false); }
private bool OnAgree(int eventId, object arg) { TargetGo.SetActive(true); return(false); }
public override void OnOpen() { base.OnOpen(); TargetGo.SetActive(false); FriendsInfoController.Instance.GetDispatcher().AddListener(FriendsInfoEvent.onAgreeFriend, OnAgree); }
//2秒后关闭该窗口 //private IEnumerator CloseWindow() //{ // yield return 2f; // WindowShowOrHide(false); //} //合成成功窗口的显示与隐藏 private void WindowShowOrHide(bool isShow) { TargetGo.SetActive(isShow); }
public override void OnOpen() { base.OnOpen(); TargetGo.SetActive(false); MessageController.Instance.GetDispatcher().AddListener(MessageEvent.OnClickSystemMsg, ShowSystemMsg); }
private void OnClickCloseBtn() { TargetGo.SetActive(false); MusicManager.Instance.Playsfx(AudioNames.CloseBtn); }
//购买窗口的隐藏与显示 private void WindowHideOrShow(bool isShow) { TargetGo.SetActive(isShow); }