Beispiel #1
0
 //private bool skipMove;
 // Start is called before the first frame update
 protected override void Start()
 {
     GameManager.instance.AddEnemyToList(this);
     target   = GameObject.FindGameObjectWithTag("Player").transform;
     lootDrop = GetComponent <LootScript>();
     base.Start();
 }
Beispiel #2
0
    private LootScript GetLootPref()
    {
        LootScript ls = l_Pool[0];

        l_Pool.Remove(ls);
        l_Active.Add(ls);
        return(ls);
    }
 // Use this for initialization
 void Start()
 {
     GameManagerScript.MyGameManager.AddHazard(this);
     GameManagerScript.MyGameManager.AddEnemy(this);
     myRenderer = GetComponent <SpriteRenderer>();
     OnSpawn(transform.position, vesselType);
     myLoot = GetComponent <LootScript>();
 }
Beispiel #4
0
 void Start()
 {
     PlayerHp    = GetComponent <Hpbar>();
     anim        = GetComponent <Animator>();
     Loot        = GetComponent <LootScript>();
     boxCollider = GetComponent <BoxCollider>();
     currentHp   = FullHp;
 }
    // Update is called once per frame



    public void DropLoot()
    {
        if (GetComponent <LootScript>() != null)
        {
            LootScript _lootComp = GetComponent <LootScript>();
            _lootComp.DropLoot();
        }
    }
    void Awake()
    {
        animt = GetComponent <Animator>();
        loot  = GetComponent <LootScript>();

        hitParticle = GetComponentInChildren <ParticleSystem>();
        enemyaudio  = GetComponent <AudioSource>();
        nav         = GetComponent <NavMeshAgent>();
    }
Beispiel #7
0
 public void DespawnLoot(LootScript ls)
 {
     if (l_Active.Contains(ls))
     {
         l_Pool.Add(ls);
         l_Active.Remove(ls);
         GivePlayerItem(ls.data);
         ls.Hide();
     }
 }
Beispiel #8
0
 private void Start()
 {
     Instance = this;
     for (int i = 0; i < MaxNumberOfLoot; i++)
     {
         GameObject obj = Instantiate(lootPrefab, gameObject.transform);
         LootScript ls  = obj.GetComponent <LootScript>();
         ls.Hide();
         l_Pool.Add(ls);
     }
 }
Beispiel #9
0
    public void AddItemToInventory(LootScript theItem)
    {
        print("Adding: " + theItem.id + " to the intory");
        intory.Add(theItem);

        for (int i = 0; i < intory.Count; i++)
        {
            if (!Gui.intory[i])
                Gui.intory[i] = intory[i].inventoryPic;
        }
    }
Beispiel #10
0
    public void monsterSpawnControl(int Currenthourglassnum)
    {
        if (Currenthourglassnum == 4)
        {
            lootsystem   = enemy[2].GetComponent <LootScript>();
            spawnTime[0] = 9;
            spawnTime[1] = 18;
            spawnTime[2] = 42;

            lootsystem.enabled = false;
        }
    }
Beispiel #11
0
    public virtual void Damage(int damage, Collider2D collision)
    {
        StartCoroutine(DamageEffect());

        currentLife -= damage;

        lifeBar.Actualize(currentLife);

        FloatingHitController.CreateFloatingHit(damage.ToString(), transform);

        if (currentLife <= 0)
        {
            LootScript loot = gameObject.GetComponent <LootScript>();

            if (loot != null)
            {
                loot.InstantiateLoot();
            }

            Destroy(gameObject);
        }
    }
Beispiel #12
0
 private void Awake()
 {
     loot = GetComponent <LootScript>();
 }
Beispiel #13
0
 // Start is called before the first frame update
 void Start()
 {
     lootScript = GetComponent <LootScript>();
 }
Beispiel #14
0
    void Start()
    {
        id = renderer.material.mainTexture.name;
        amount = 1;
        type = "inven";
        inventoryPic = renderer.material.mainTexture;
        unit = GameObject.Find("Cube");
        Gui = unit.GetComponent<GUIScript>();
        un = unit.GetComponent<unitScript>();
        Lo = GetComponent<LootScript>();
        _inventory = unit.GetComponent<Inventory>();//new Inventory(unit, Gui);

        switch (id)
        {
            case "HP potion":
                stackable = true;
                Consumeable = true;
                break;
            case "Armor potion":
                stackable = true;
                Consumeable = true;
                break;
            case "Strenght potion":
                stackable = true;
                Consumeable = true;
                break;
            case "Snail slime":
                stackable = true;
                Consumeable = false;
                break;
            case "Sword switcher":
                stackable = false;
                Consumeable = false;
                break;
            case "Mushroom":
                stackable = true;
                Consumeable = false;
                break;
        }
    }