示例#1
0
 private void PauseRegister()
 {
     TargetGo.SetActive(false);
     RegisterViewTweener = DotweenManager.DOLocalMoveY(lv.RegisterView).SetAutoKill(false);
     //确保此方法只运行一次
     EnterGameTweener.onPause -= PauseRegister;
 }
示例#2
0
 private void Pause()
 {
     TargetGo.SetActive(false);
     ChangePWViewTweener = DotweenManager.DOLocalMoveY(lv.ChangePWView).SetAutoKill(false);
     //确保此方法只运行一次
     EnterGameTweener.onPause -= Pause;
 }
示例#3
0
        //购买成功回调
        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);
        }
示例#4
0
 public override void OnOpen()
 {
     base.OnOpen();
     CountInput.text = "0";
     TargetGo.SetActive(false);
     StoreController.Instance.GetDispatcher().AddListener(StoreEvent.OnStoreUnits, InitSFc);
 }
示例#5
0
 public override void OnOpen()
 {
     base.OnOpen();
     TargetGo.SetActive(false);
     ShopController.Instance.GetDispatcher().AddListener(ShopEvent.OnSelectShopItem, OnSelectShopItem);
     ShopController.Instance.GetDispatcher().AddListener(ShopEvent.OnBuying, OnBuying);
 }
示例#6
0
 //点击关闭按钮
 private void OnClickCloseBtn()
 {
     MusicManager.Instance.Playsfx(AudioNames.CloseBtn);
     StoreController.Instance.currentSellID     = 0;
     StoreController.Instance.currentSellNumber = 0;
     TargetGo.SetActive(false);
 }
示例#7
0
        private bool ShowSystemMsg(int eventId, object arg)
        {
            string content = (string)arg;

            Content.text = content;
            TargetGo.SetActive(true);
            return(false);
        }
示例#8
0
        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;
        }
示例#10
0
文件: ChatMsgView.cs 项目: rerwr/test
        //打开chatview
        private bool OnOpenChatView(int eventId, object arg)
        {
            bool isChating = (bool)arg;

            TargetGo.SetActive(isChating);
            if (TargetGo.activeInHierarchy)
            {
                OnReviceLog(0, null);
            }
            return(false);
        }
示例#11
0
        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;
        }
示例#13
0
        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);
        }
示例#14
0
 //该窗口的隐藏于显示
 private void WindowShowOrHide(bool isOpen)
 {
     Introduce_Scroll.verticalNormalizedPosition = 1;
     TargetGo.SetActive(isOpen);
 }
示例#15
0
 private void OnClickCloseBtn()
 {
     TargetGo.SetActive(false);
 }
示例#16
0
 private bool OnAgree(int eventId, object arg)
 {
     TargetGo.SetActive(true);
     return(false);
 }
示例#17
0
 public override void OnOpen()
 {
     base.OnOpen();
     TargetGo.SetActive(false);
     FriendsInfoController.Instance.GetDispatcher().AddListener(FriendsInfoEvent.onAgreeFriend, OnAgree);
 }
示例#18
0
        //2秒后关闭该窗口
        //private IEnumerator CloseWindow()
        //{
        //    yield return 2f;
        //    WindowShowOrHide(false);
        //}

        //合成成功窗口的显示与隐藏
        private void WindowShowOrHide(bool isShow)
        {
            TargetGo.SetActive(isShow);
        }
示例#19
0
 public override void OnOpen()
 {
     base.OnOpen();
     TargetGo.SetActive(false);
     MessageController.Instance.GetDispatcher().AddListener(MessageEvent.OnClickSystemMsg, ShowSystemMsg);
 }
示例#20
0
 private void OnClickCloseBtn()
 {
     TargetGo.SetActive(false);
     MusicManager.Instance.Playsfx(AudioNames.CloseBtn);
 }
示例#21
0
 //购买窗口的隐藏与显示
 private void WindowHideOrShow(bool isShow)
 {
     TargetGo.SetActive(isShow);
 }