Author Topic: Searching in database and then instantiate  (Read 1113 times)


  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Searching in database and then instantiate
« on: February 06, 2013, 03:50:13 PM »
Hi !

First of all, I want to apologize for my bad english, I am not a native speaker.

Well, I have a few questions because i am fairly new to Unity... Yes, we can say that i am a noob  :P

I am using SQLite and i've created a database nammed "Stuff", and within it a table called "OneHand" where I create all the stats for my first weapon ! And after that i was trying since few days to "call" this weapon with SQLiteKit and Playmaker within my NGUI (Yes, i've spent a lot of my money in the Asset Store ! xD ) character creation menu. Because i have set different classes (Warrior, Hunter and Mage for now) I want the starting stuff to change when we select a class. We can see already the toon displayed but without any armor and weapon for now...

So, here are the questions !

1) Does someone have any clue for how to instantiate this weapon with just its name in a string ?

Let me explain, i have created a folder "resources" and in some sub-folders (/Prefab/Items/Weapons/OneHand) I have the prefab of a weapon which will always be nammed the same as in the database. For exemple, my "Old Sword" prefab has an "Old Sword" entry in the table OneHand.

The problem is : i can't find actions for "Resources.Load()" in the actions browser. (I tryed to create a custom action for that but... I'm a noob... ^^' ) After that, i was thinking of creating a new C# class for items, but i am struck here too ! :(

2) How can i set name, price, damage, rarity... of my item with the database ? I was thinking of using List<>, but don't know really how to use it in that way...

3) BONUS - Is there actions for PoolManager 4 ? i can't find anything about that, and in the Playmaker wiki i've found only actions for PoolManager 2... which gives me an error if i import it in my project  :(

i think that's all for now ! Thanks to anyone in advance for helping me ;)