Exemplo n.º 1
0
    public void Begin()
    {
        GameObject.Find("Melody_AudioSource").SetActive(false);


        DOTween.Sequence()
        .AppendInterval(1)
        .AppendCallback(() => transform.Find("Laugh_Audio").GetComponent <AudioSource>().Play())
        .AppendInterval(4)
        .AppendCallback(() =>
        {
            _sprite.sprite = HandsUp;
            transform.Find("Spell_Audio").GetComponent <AudioSource>().Play();
        })
        .Append(_sprite.transform.DOMove(Vector3.up * 2, 3).SetEase(Ease.InQuad).SetRelative(true))
        .AppendInterval(4.5f)
        .AppendCallback(() => {
            HeroStats.Get().DirectHealth = 40;
        })
        .AppendInterval(1)
        .AppendCallback(() => ScreenFade.Instance.FadeOut(0.2f))
        .AppendInterval(0.2f)
        .AppendCallback(() => SceneManager.LoadScene("Level11"))
        .SetUpdate(true);
    }
Exemplo n.º 2
0
 private void OnEnable()
 {
     _stats = HeroStats.Get();
     SoulsToUnlockText.text = SoulsToUnlock != -1 ? SoulsToUnlock.ToString() + "\nSOUL" : string.Empty;
     _spawners = FindObjectsOfType <SpawnerSpawn>();
     InvokeRepeating("SlowerUpdate", .5f, .5f);
 }
Exemplo n.º 3
0
 private void OnEnable()
 {
     _stats        = HeroStats.Get();
     _body         = GetComponent <Rigidbody2D>();
     _fly          = GetComponent <ArrowFly>();
     _lastPosition = Vector2.one * 123;
     _startTime    = Time.time;
 }
Exemplo n.º 4
0
 private void Aimlogic()
 {
     if (_state == RushState.Aim)
     {
         _lookAt.Position       = _player.position;
         _targetMarker.position = Vector3.MoveTowards(_targetMarker.position, _player.position,
                                                      _aimingProgress < 0.8f
             ? HeroStats.Get().MovementSpeed *_aimingProgress * 0.5f * Time.deltaTime
             :(_aimingProgress < 0.93f)
                 ? HeroStats.Get().MovementSpeed * 1.2f * Time.deltaTime
                 : HeroStats.Get().MovementSpeed * 2f * Time.deltaTime);
     }
 }
Exemplo n.º 5
0
    private void OnEnable()
    {
        _stats = HeroStats.Get();

        if (!HeroStats.Get().Dagger)
        {
            gameObject.SetActive(false);
        }
        else
        {
            transform.SetParent(null);
        }
    }
Exemplo n.º 6
0
    public void BuyLogic(Action <HeroStats> upgradeImplementation)
    {
        var stats = HeroStats.Get();

        if (stats.Health < Price)
        {
            Debug.LogWarning("Insufficient souls." + stats.Health + "/" + Price);
        }

        Destroy(GameObject.Find("MerchantWindow_Object"));
        HeroStats.Get().GetComponent <PlayerMove>().enabled = false;
        GameObject.Find("MerchantBuy_Audio").GetComponent <AudioSource>().Play();
        ChangeMerchantSprite("MerchantHands_Sprite", true);
        ChangeMerchantSprite("MerchantSit_Sprite", false);

        DOTween.Sequence()
        .AppendInterval(1.5f)
        .AppendCallback(() =>
        {
            if (stats.Health <= Price)
            {
                stats.DirectHealth = 20;
            }
            else
            {
                stats.DirectHealth = Mathf.Min(stats.DirectHealth - Price, 50);
            }
        })
        .AppendInterval(1f)
        .AppendCallback(() =>
        {
            upgradeImplementation.Invoke(stats);
            var playerObj = HeroStats.Get();
            if (playerObj != null)
            {
                var move = playerObj.GetComponent <PlayerMove>();
                if (move != null)
                {
                    move.enabled = true;
                }

                ChangeMerchantSprite("MerchantSit_Sprite", true);
                ChangeMerchantSprite("MerchantHands_Sprite", false);
            }
        });
    }
Exemplo n.º 7
0
    private void Update()
    {
        if (SceneManager.GetActiveScene().name != "Level11")
        {
            return;
        }

        foreach (var spawner in _spawners)
        {
            if (spawner.SpawnLimit > 0)
            {
                return;
            }
        }

        foreach (var monster in FindObjectsOfType <Monster>())
        {
            if (monster != GetComponent <Monster>())
            {
                return;
            }
        }

        transform.Find("RedHead1_Sprite").GetComponent <SpriteRenderer>().sprite = UpArms;
        GetComponent <SlowEnemyFollow>().enabled          = true;
        GetComponent <Collider2D>().enabled               = true;
        GetComponent <ArroundProjectileShooter>().enabled = false;
        GetComponent <HornayNailsShooter>().enabled       = true;
        var stats = GetComponent <EnemyStats>();

        stats.ProjectilesSpeed            = 10;
        stats.ProjectilesCount            = 30;
        stats.ProjectilesAuthoShootPeriod = 2f;
        stats.Damage = 20;

        HeroStats.Get().Health -= 50;

        Destroy(this);
    }
Exemplo n.º 8
0
 private void OnEnable()
 {
     _stats             = HeroStats.Get();
     _startedWithHealth = _stats.Health;
 }
Exemplo n.º 9
0
 private void OnEnable()
 {
     _stats = HeroStats.Get();
 }
Exemplo n.º 10
0
 private void OnEnable()
 {
     Time.timeScale = 1;
     _stats         = HeroStats.Get();
 }
Exemplo n.º 11
0
 private void OnEnable()
 {
     _bow    = GetComponentInParent <ArrowShoot>();
     _stats  = HeroStats.Get();
     _sprite = GetComponentInChildren <SpriteRenderer>();
 }
Exemplo n.º 12
0
 private void OnEnable()
 {
     _stats       = GetComponent <EnemyStats>();
     _player      = HeroStats.Get().transform;
     _startHealth = _stats.Health;
 }