コード例 #1
0
        /// <summary>
        /// Gets the object that should be spawned
        /// </summary>
        /// <returns></returns>
        protected virtual GameObject GetObject()
        {
            _objectToSpawn = null;
            switch (LootMode)
            {
            case LootModes.Unique:
                _objectToSpawn = GameObjectToLoot;
                break;

            case LootModes.LootTableScriptableObject:
                if (LootTableSO == null)
                {
                    _objectToSpawn = null;
                    break;
                }
                _objectToSpawn = LootTableSO.GetLoot();
                break;

            case LootModes.LootTable:
                _objectToSpawn = LootTable.GetLoot()?.Loot;
                break;
            }

            return(_objectToSpawn);
        }
コード例 #2
0
 /// returns an object from the loot table
 public virtual GameObject GetLoot()
 {
     return(LootTable.GetLoot()?.Loot);
 }