Exemplo n.º 1
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            if (other.CompareTag("SkillGem") && !GameManager.Instance.isPlayerCarryingGem)
            {
                _canPickupGem = true;
                _gemToPickup  = other.GetComponent <SkillGem>();
            }

            else if (other.CompareTag("Key") && !GameManager.Instance.isPlayerCarryingGem)
            {
                _canPickupKey = true;
                _keyToPickup  = other.GetComponent <Key>();
            }

            if (other.CompareTag("SkillSlot"))
            {
                _canPlaceGem = true;
                _skillSlot   = other.GetComponent <SkillSlot>();
            }
        }
Exemplo n.º 2
0
Arquivo: Bug.cs Projeto: sballew/LD47
        private void Start()
        {
            // Pick where to navigate to.
            if (_bugType == BugType.HealthAttacker)
            {
                _moveToPosition       = GetRandomPosition(GameManager.Instance.healthAttackFromZone);
                _attackTargetPosition = GetRandomPosition(GameManager.Instance.healthAttackTargetZone);
            }
            else if (_bugType == BugType.SkillStealer)
            {
                // Pick a skill
                _skillToSteal = GameManager.Instance.GetRandomFilledSkill();

                if (_skillToSteal == null)
                {
                    // Nothing to do.
                    Destroy(this.gameObject);
                    return;
                }

                _moveToPosition = _skillToSteal.transform.position + (Vector3.up * 1.5f);
            }
        }