Esempio n. 1
0
    /// <summary>아이템 생성(아이템 초기화 및 dictionary 추가)</summary>
    /// <param name="_spawnerId">아이템ID</param>
    /// <param name="_position">아이템 position</param>
    /// <param name="_hasItem">아이템 존재여부</param>
    public void CreateItemSpawner(int _spawnerId, Vector3 _position, ItemType _type, bool _hasItem, bool _modelEnabled)
    {
        ItemSpawner _spawner = (Instantiate(itemSpawnerObject[_type], _position, itemSpawnerObject[_type].transform.rotation)).GetComponent <ItemSpawner>();

        _spawner.Initialize(_spawnerId, _hasItem, _modelEnabled);
        itemSpawners.Add(_spawnerId, _spawner);
    }
    public void CreateItemSpawner(int id, Vector3 pos, bool hasItem)
    {
        ItemSpawner itemSpawner = Instantiate(itemSpawnerPrefab, pos, itemSpawnerPrefab.transform.rotation).GetComponent <ItemSpawner>();

        itemSpawner.Initialize(id, hasItem);

        itemSpawners.Add(id, itemSpawner);
    }