Example #1
0
 void SpawnChance()
 {
     if (GetComponent <ItemSpawner>().itemsAwake.Count <= 10)
     {
         float randomChance = Random.Range(0, 100);
         if (randomChance < 20)
         {
             GameObject a = Instantiate(selector.SpawnItem(selector.RandomDrop()),
                                        transform.position,
                                        Quaternion.Euler(new Vector3(0, 90, 0))) as GameObject;
             itemsAwake.Add(a);
         }
     }
 }
Example #2
0
    public override void FunctionBeta()
    {
        int chance = Random.Range(0, 100);

        if (chance <= 15)
        {
            //explode
        }
        else
        {
            ItemSelector select = spawner.GetComponent <ItemSelector>();
            GameObject   a      = Instantiate(select.SpawnItem(select.RandomDrop()),
                                              transform.position,
                                              Quaternion.Euler(new Vector3(0, 90, 0))) as GameObject;
        }
        durability--;
        base.FunctionBeta();
    }