Ejemplo n.º 1
0
 private void Update()
 {
     if (_isLerp)
     {
         int totalCoin = VirusGameDataAdapter.GetCurLevelCoin();
         _lastCoin = Mathf.Lerp(_lastCoin, totalCoin, Time.deltaTime * 5);
         if (Mathf.Abs(_lastCoin - totalCoin) < 0.1f)
         {
             _isLerp = false;
         }
         _coinText.text = VirusTool.GetStrByIntger(Mathf.CeilToInt(_lastCoin));
     }
 }
Ejemplo n.º 2
0
    public virtual void Born(VirusData virusData)
    {
        VirusSprite = transform.GetComponent <BaseVirusSprite>();
        VirusSprite.Initi(virusData.VirusColorLevel);
        VirusHealth       = new RectiveProperty <float>();
        VirusHealth.Value = virusData.HealthValue;
        HealthBar.Initi(VirusTool.GetStrByIntger(virusData.HealthValue));
        VirusHealth.Subscibe(HealthBar.SetValue);

        SplitLevel       = virusData.SplitLevel;
        CurColorLevel    = virusData.VirusColorLevel;
        OriginColorLevel = virusData.VirusColorLevel;
        TotalHealth      = virusData.HealthValue;

        ScaleX = VirusTool.GetScaleByLevel(virusData.SplitLevel);
        transform.localScale = new Vector3(ScaleX, ScaleX, 1);
        VirusMove.Initi(virusData.MoveSpeed, virusData.MoveDirection);

        transform.GetComponent <VirusBuffMrg>().Initi();
        IsDeath = false;
    }
Ejemplo n.º 3
0
        void ShowCoinData()
        {
            int coin     = VirusGameDataAdapter.GetCurLevelCoin();
            int jiaCheng = UnityEngine.Random.Range(10, 100);

            if (IGamerProfile.Instance != null)
            {
                UiSceneSelectGameCharacter.CharacterId     id = UiSceneSelectGameCharacter.CharacterId.ShouYi;
                IGamerProfile.PlayerData.PlayerChacterData dt = IGamerProfile.Instance.playerdata.characterData[(int)id];
                GameCharacter.CharacterData characterDt       = IGamerProfile.gameCharacter.characterDataList[(int)id];
                jiaCheng = characterDt.LevelBToVal.GetValue(dt.levelB); //关卡加成
            }

            int jiaChengCoin = Mathf.CeilToInt(jiaCheng * coin / 100f);
            int totalCoin    = coin + jiaChengCoin;

            _coinData.CoinText.text         = VirusTool.GetStrByIntger(coin);
            _coinData.TotalCoinText.text    = VirusTool.GetStrByIntger(totalCoin);
            _coinData.JiaChengText.text     = jiaCheng.ToString() + "%:";
            _coinData.JiaChengCoinText.text = VirusTool.GetStrByIntger(jiaChengCoin);
        }
Ejemplo n.º 4
0
 private void Update()
 {
     if (_isLerp)
     {
         int totalCoin = VirusGameDataAdapter.GetTotalCoin();
         _lastCoin = Mathf.Lerp(_lastCoin, totalCoin, Time.deltaTime * 5);
         if (Mathf.Abs(_lastCoin - totalCoin) < 0.1f)
         {
             _isLerp = false;
             _isSet  = false;
         }
         _coinText.text = VirusTool.GetStrByIntger(Mathf.RoundToInt(_lastCoin));
         _totalTime    -= Time.deltaTime;
         if (_totalTime <= 0 && _num > 0)
         {
             _num--;
             VirusSoundMrg.Instance.PlaySound(VirusSoundType.TotalCoin);
             _totalTime = 0.15f;
         }
     }
 }
Ejemplo n.º 5
0
 public void SetCoinText(int coin)
 {
     _coinText.text = VirusTool.GetStrByIntger(coin);
 }
 public void SetCoinText()
 {
     _coinText.text = VirusTool.GetStrByIntger(VirusGameDataAdapter.GetTotalCoin());
     //Debug.Log("test ======== " + _coinText.text);
 }
Ejemplo n.º 7
0
    public void SetValue(float value)
    {
        int vv = Mathf.CeilToInt(value);

        _healthText.text = VirusTool.GetStrByIntger(vv);
    }
Ejemplo n.º 8
0
        public void SetCoinText()
        {
            string str = VirusTool.GetStrByIntger(VirusGameDataAdapter.GetTotalCoin());

            _coinText.text = str;
        }