├── .gitignore ├── README.md ├── README.md.meta ├── Scripts.meta ├── Scripts ├── Quest.cs ├── Quest.cs.meta ├── QuestItem.cs ├── QuestItem.cs.meta ├── QuestManager.cs └── QuestManager.cs.meta ├── ThirdParty.meta └── ThirdParty ├── UnityMainThreadDispatcher.meta └── UnityMainThreadDispatcher ├── LICENSE ├── LICENSE.meta ├── README.md ├── README.md.meta ├── UnityMainThreadDispatcher.cs ├── UnityMainThreadDispatcher.cs.meta ├── UnityMainThreadDispatcher.prefab └── UnityMainThreadDispatcher.prefab.meta /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | .DS_Store 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityQuestSystem 2 | 3 | A super simplistic, but powerful quest system for Unity games. 4 | 5 | Quests can be entirely managed by you or you can use one of the build in preset types: 6 | 7 | - Destination based 8 | 9 | - Item fetching (works with any inventory system!) 10 | 11 | Quests can optional be timed, and automatically fail if they time out. 12 | 13 | Quests can also be nested to unlimited depth, meaning your quests can have children, who have children, who have children... 14 | 15 | You can require these nested quests to either be completed in parallel or sequentially. 16 | 17 | Quests can also have optional rewards that you should give to the player once they have completed it. 18 | 19 | # Examples 20 | 21 | ## Basic "Destination" Quest 22 | 23 | Give a quest to a player that contains a `QuestManager` 24 | 25 | ```cs 26 | using Boxxen.Quests; 27 | .. 28 | 29 | void OnTriggerEnter (Collider other) { 30 | // Create a new destination-based quest 31 | Quest quest = new Quest("Get to the destination!", QuestType.destination); 32 | 33 | // Here we find our destination, and pass it's coordinates to the quest 34 | quest.SetDestination(GameObject.Find("Destination")); 35 | 36 | // Let's add a time limit to this quest, this is completely optional though. 37 | // 1 minute should be enough time. 38 | quest.SetTimeLimit(60); 39 | 40 | // Lets start our quest. This will set its status to inProgress 41 | // and also start the time limit if you've set one. 42 | quest.Start(); 43 | 44 | // Here we add it to our quest manager, so it can help track all of our quests. 45 | other.GetComponent().AddQuest(quest); 46 | } 47 | ``` 48 | 49 | ## Basic "Fetch" Quest 50 | 51 | Create a quest where the player needs to find an item with the ID of "Shield" 52 | 53 | **QuestGiver.cs:** 54 | 55 | ```cs 56 | using Boxxen.Quests; 57 | .. 58 | 59 | void OnTriggerEnter (Collider other) { 60 | // Create a new quest with the type `QuestType.fetch` 61 | Quest quest = new Quest("Find the shield", QuestType.fetch); 62 | 63 | // Generate the item we 64 | QuestItem item = new InventoryItem("Shield"); 65 | 66 | quest.AddItemToFetch(item); 67 | 68 | quest.Start(); 69 | 70 | other.GetComponent().AddQuest(quest); 71 | } 72 | ``` 73 | 74 | **ItemGiver.cs:** 75 | 76 | This script should be attached to something that gives out items. 77 | 78 | ```cs 79 | using Boxxen.Quests; 80 | .. 81 | 82 | void OnTriggerEnter (Collider other) { 83 | // Generate the item we want to give to the user 84 | QuestItem item = new InventoryItem("Shield"); 85 | 86 | // In this example, we just call QuestManager#ItemFetched, in a real game you would also add it to the player inventory and do other things too. 87 | other.GetComponent().ItemFetched(item); 88 | } 89 | ``` 90 | 91 | ## Nested destination + fetch quest 92 | 93 | This example will create a quest with 2 children quests in it, the first quest will require the user to go to a particular location, and the second quest will require a user to find an item. This is a typical pattern you see in lots of games - "Go to the field and find a mushroom" 94 | 95 | ```cs 96 | using Boxxen.Quests; 97 | .. 98 | 99 | void OnTriggerEnter (Collider other) { 100 | // We need a quest as a 'parent' of the two child quests 101 | Quest parentQuest = new Quest("Do this for me..", QuestType.nested); 102 | 103 | // Create our first quest 104 | Quest destinationQuest = new Quest("Go to the field", QuestType.destination); 105 | 106 | // Add the location of the Field GameObject as the destination for our first quest 107 | destinationQuest.SetDestination(GameObject.Find("Field")); 108 | 109 | // Create our second quest 110 | Quest fetchQuest = new Quest("Find 10 Magic Mushrooms", QuestType.fetch); 111 | 112 | // Generate the item we need the user to fetch 113 | QuestItem mushroom = new InventoryItem("Magic Mushroom"); 114 | 115 | // Add the mushroom 10 times to our second quest. 116 | for (int i = 0; i < 10; i++) { 117 | fetchQuest.AddItemToFetch(mushroom); 118 | } 119 | 120 | // Lets add our child quests to our main quest 121 | parentQuest.AddQuest(destinationQuest); 122 | parentQuest.AddQuest(fetchQuest); 123 | 124 | // The default NestedQuestType of a parent quest is NestedQuestType.sequential 125 | // but it is added here to demonstrate that it's possible to change. 126 | parentQuest.SetNestedQuestType(NestedQuestType.sequential); 127 | 128 | // Note how we call start on our parent quests, and not each child quest 129 | // This ensures that they are started in the correct order dictated by NestedQuestType 130 | parentQuest.Start(); 131 | 132 | // Find our QuestManager instance 133 | QuestManager questManager = other.GetComponent(); 134 | 135 | // We only add our parentQuest to our QuestManager, as our 136 | // destinationQuest and fetchQuest are children of parentQuest. 137 | questManager.AddQuest(parentQuest); 138 | 139 | // We can ask QuestManager to start tracking the players location. 140 | questManager.StartTrackingLocation(); 141 | } 142 | ``` 143 | 144 | # API 145 | 146 | ## **QuestItem** 147 | 148 | A basic interface describing an item. 149 | Your inventory items should fulfil this interface so you can cast them. 150 | 151 | ``` 152 | id: string 153 | ``` 154 | 155 | Example class: 156 | 157 | ```cs 158 | using Boxxen.Quests; 159 | 160 | class InventoryItem : QuestItem { 161 | private string _id; 162 | public InventoryItem (string id) { 163 | _id = id; 164 | } 165 | public string id { get { return _id; } } 166 | } 167 | ``` 168 | 169 | ## **QuestType** 170 | 171 | An enum of different quest types. 172 | 173 | Possible values: 174 | - **none**: Manage the quest entirely on your own. 175 | - **destination**: Make the player go to a specific location 176 | - **fetch**: Make the player fetch specific items 177 | - **nested**: A "parent" quest which will have nested quests 178 | 179 | ## **QuestStatus** 180 | 181 | An enum of different quest statuses. 182 | 183 | Possible values: 184 | - **notStarts**: The quest has not started. 185 | - **inProgress**: The quest is in progress. 186 | - **completed**: The quest has been completed. 187 | - **failed**: The quest has been failed. 188 | 189 | ## **NestedQuestType** 190 | 191 | An enum describing how nested quests should be treated. 192 | 193 | Possible values: 194 | - **sequential**: Require quests be completed in the order they were added. 195 | - **parallel**: Allow the quests to be completed it any order. 196 | 197 | ## **QuestManager()** 198 | 199 | A _QuestManager_ maintains a list of quests, multiple _QuestManagers_ can exist can exist in a single scene, allowing you to manage different character quest lists for example. 200 | 201 | Using a _QuestManager_ is not required, you can manage your _Quest_s directly if you wish. 202 | 203 | ### **QuestManager#AddQuest(Quest quest)** 204 | 205 | Add a new quest to this instance of _QuestManager_ 206 | 207 | ### **QuestManager#GetQuests()** 208 | 209 | Returns `List` 210 | 211 | Returns a list of quests that are managed by this _QuestManager_ 212 | 213 | ### **QuestManager#GetQuests(QuestStatus filter)** 214 | 215 | Returns `List` 216 | 217 | Returns a list of quests that are managed by this _QuestManager_, filtering out those which do not match the filter passed in. 218 | 219 | ### **QuestManager#StartTrackingLocation(float interval = 1f)** 220 | 221 | Every _interval_ **QuestManager#CheckLocation()** will be called. 222 | 223 | This is a helper function as is _not_ required to be used if you want to manage this by yourself using triggers or another mechanism. 224 | 225 | ### **QuestManager#StopTrackingLocation()** 226 | 227 | If **QuestManager#StartTrackingLocation** has been called, calling this function will stop tracking the position of the _GameObject_ this _GameManager_ is attached to. 228 | 229 | ### **QuestManager#CheckLocation()** 230 | 231 | The _GameObject_ that this instance of _QuestManager_ is attached to will be checked against the current _QuestStatus.inProgress_ quests. If the location overlaps with any of the quests destinations, that quest will be marked as complete. 232 | 233 | This is a helper function as is _not_ required to be used if you want to manage this by yourself using triggers or another mechanism. 234 | 235 | ### **QuestManager#ItemFetched(QuestItem item)** 236 | 237 | This function will iterate over all quests and call **Quest#ItemFetched(item)** 238 | 239 | This is a helper function as is _not_ required to be used if you want to manage this by yourself using triggers or another mechanism. 240 | 241 | ## **Quest(string name, QuestType type)** 242 | 243 | Initialise a new quest. 244 | 245 | ### **Quest#GetQuestType()** 246 | 247 | Returns `QuestType` 248 | 249 | ### **Quest#QuestTypeString()** 250 | 251 | Returns `string` 252 | 253 | The string equivalent of the current quest type 254 | 255 | ### **Quest#GetStatus()** 256 | 257 | Returns `QuestStatus` 258 | 259 | ### **Quest#SetStatus(QuestStatus newStatus)** 260 | 261 | Sets the status of the quest. 262 | 263 | ### **Quest#AddReward(QuestItem reward)** 264 | 265 | Add a new reward that should be granted upon quest completion. 266 | 267 | ### **Quest#GetRewards()** 268 | 269 | Returns `List` 270 | 271 | ### **Quest#SetDestination(GameObject destination)** 272 | 273 | Only to be used when the quest type is set to `QuestType.destination`. 274 | 275 | Sets the destination of the quest. 276 | 277 | ### **Quest#SetDestination(Bounds destination)** 278 | 279 | Like above. 280 | 281 | ### **Quest#GetDestination()** 282 | 283 | Returns `Bounds` 284 | 285 | Returns the destination of a quest if one has been set. 286 | 287 | **Example:** 288 | 289 | ``` 290 | quest.SetDestination(GameObject.Find("Destination")); 291 | ``` 292 | 293 | ### **Quest#SetTimeLimit(float seconds)** 294 | 295 | Give this quest a time limit. 296 | 297 | Time will only count down once `Quest#Start()` has been called. 298 | 299 | If the time limit gets to 0 before the quest has been completed, it will be failed. 300 | 301 | ### **Quest#HasTimeLimit()** 302 | 303 | Returns `bool` 304 | 305 | Returns `true` if the quest has a time limit. 306 | 307 | ### **Quest#GetTimeLimit()** 308 | 309 | Returns `float` 310 | 311 | Returns the total time limit if one is set. This does **not** return the remaining time if a countdown has already started. 312 | 313 | ### **Quest#GetTimeRemaining()** 314 | 315 | Returns `float` 316 | 317 | Returns the remaining time of a countdown if one has started. 318 | 319 | ### **Quest#ResetTimer()** 320 | 321 | Resets the countdown timer if one is set. 322 | 323 | ### **Quest#CompleteQuest()** 324 | 325 | This will complete a quest. 326 | 327 | `Quest#GetStatus()` will return `QuestStatus.completed`. 328 | 329 | Quest completion events will also fire. 330 | 331 | ### **Quest#FailQuest()** 332 | 333 | This will fail a quest. 334 | 335 | `Quest#GetStatus()` will return `QuestStatus.failed`. 336 | 337 | Quest failure events will also fire. 338 | 339 | ### **Quest#IsChildQuest()** 340 | 341 | Returns `bool`. 342 | 343 | Returns `true` if this quest is a child of a nested quest. 344 | 345 | ### **Quest#AddQuest(Quest childQuest)** 346 | 347 | Only to be used when quest type is set to `QuestType.nested`. 348 | 349 | Adds a child quest to this quest. 350 | 351 | ### **Quest#GetChildQuests()** 352 | 353 | Returns `List`. 354 | 355 | Returns a list of child quests. 356 | 357 | ### **Quest#SetNestedQuestType(NestedQuestType type)** 358 | 359 | Will change the required completion order of child quests. 360 | 361 | If `NestedQuestType.sequential` is passed, child quests must be completed in the order they were added to this quest. 362 | 363 | If `NestedQuestType.parallel` is passed, child quests can be completed in any order. 364 | 365 | ### **Quest#AddItemToFetch(QuestItem item)** 366 | 367 | Only to be used when the quest type is set to `QuestType.fetch`. 368 | 369 | Adds an item that is required to be fetched. 370 | 371 | ### **Quest#RemoveItemToFetch(QuestItem item)** 372 | 373 | Only to be used when the quest type is set to `QuestType.fetch`. 374 | 375 | Removes an item that is required to be fetched. 376 | 377 | ### **Quest#GetItemsToFetch()** 378 | 379 | Returns `List` 380 | 381 | ### **Quest#GetItemsFetched()** 382 | 383 | Returns `List` 384 | 385 | ### **Quest#ItemFetched(QuestItem item)** 386 | 387 | To be called when the player has received an item. 388 | 389 | ### **Quest#Start()** 390 | 391 | Starts a quest. 392 | 393 | If the quest has a time limit, it will be started. 394 | 395 | ### **Quest~OnStatusChange(QuestStatus newStatus)** 396 | 397 | An event that is emitted when the quests status has changed. 398 | 399 | Example: 400 | 401 | ```cs 402 | myQuest.OnStatusChange += (status) => { 403 | Debug.Log("myQuest new status:" + status); 404 | } 405 | ``` 406 | 407 | ### **Quest~OnChildStatusChange(Quest childQuest, QuestStatus newStatus)** 408 | 409 | An event that is emitted when a nested child quest status changes. 410 | 411 | ### **Quest~OnComplete()** 412 | 413 | This event is emitted when the quest has been completed. 414 | 415 | ### **Quest~OnFailure()** 416 | 417 | This event is emitted when the quest has been failed. 418 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 981f204f391c74fd59c6ab17c4899817 3 | timeCreated: 1517015712 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93aec59ad339d41bf882f5e493b8808b 3 | folderAsset: yes 4 | timeCreated: 1516538262 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/Quest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Timers; 5 | using UnityEngine; 6 | 7 | using Boxxen.Quests; 8 | 9 | namespace Boxxen.Quests { 10 | public enum QuestType { 11 | none, 12 | destination, 13 | fetch, 14 | nested 15 | } 16 | 17 | public enum QuestStatus { 18 | notStarted, 19 | inProgress, 20 | completed, 21 | failed 22 | } 23 | 24 | public enum NestedQuestType { 25 | sequential, 26 | parallel 27 | } 28 | 29 | public class Quest { 30 | public delegate void OnStatusChangeHandler(QuestStatus newStatus); 31 | public event OnStatusChangeHandler OnStatusChange; 32 | 33 | public delegate void OnChildStatusChangeHandler (Quest childQuest, QuestStatus newStatus); 34 | public event OnChildStatusChangeHandler OnChildStatusChange; 35 | 36 | public delegate void OnCompleteHandler(); 37 | public event OnCompleteHandler OnComplete; 38 | public delegate void OnFailureHandler(); 39 | public event OnFailureHandler OnFailure; 40 | 41 | private string _name; 42 | private QuestStatus _status = QuestStatus.notStarted; 43 | 44 | private QuestType _type; 45 | 46 | private List _rewards = new List(); 47 | 48 | private Quest _parentQuest; 49 | 50 | public string name { get { return _name; } } 51 | 52 | // **** Nested-quest variables 53 | private List _childQuests = new List(); 54 | private NestedQuestType _childQuestType = NestedQuestType.sequential; 55 | // **** 56 | 57 | // **** Quest-type-specific variables here 58 | private Bounds _destination; 59 | 60 | private Timer _timer = null; 61 | private float _timeLimit = -1; 62 | private float _timeCurrent = -1; 63 | 64 | private List _itemsToFetch = new List(); 65 | private List _itemsFetched = new List(); 66 | // **** 67 | 68 | public Quest (string name, QuestType type) { 69 | _name = name; 70 | _type = type; 71 | } 72 | 73 | public QuestType GetQuestType () { 74 | return _type; 75 | } 76 | 77 | public string QuestTypeString () { 78 | switch(_type) { 79 | case QuestType.none: { 80 | return "None"; 81 | } 82 | case QuestType.destination: { 83 | return "Destination"; 84 | } 85 | case QuestType.nested: { 86 | return "Nested"; 87 | } 88 | case QuestType.fetch: { 89 | return "Fetch"; 90 | } 91 | default: { 92 | return "Unknown"; 93 | } 94 | } 95 | } 96 | 97 | public QuestStatus GetStatus () { 98 | return _status; 99 | } 100 | 101 | public void SetStatus(QuestStatus status) { 102 | _status = status; 103 | if (OnStatusChange != null) { 104 | OnStatusChange(status); 105 | } 106 | } 107 | 108 | public void AddReward (QuestItem reward) { 109 | _rewards.Add(reward); 110 | } 111 | 112 | public List GetRewards () { 113 | return _rewards; 114 | } 115 | 116 | public void SetDestination (GameObject destination) { 117 | _destination = destination.GetComponent().bounds; 118 | } 119 | 120 | public void SetDestination (Bounds destination) { 121 | _destination = destination; 122 | } 123 | 124 | public void SetTimeLimit (float seconds) { 125 | _timeLimit = seconds; 126 | _timeCurrent = seconds; 127 | } 128 | 129 | public bool HasTimeLimit () { 130 | return _timeLimit != -1; 131 | } 132 | 133 | public float GetTimeLimit () { 134 | return _timeLimit; 135 | } 136 | 137 | public void StopTimer () { 138 | _timer.Stop(); 139 | } 140 | 141 | private void DestroyTimer () { 142 | if (_timer != null) { 143 | _timer.Start(); 144 | return; 145 | } 146 | } 147 | 148 | public void ResetTimer () { 149 | _timeCurrent = _timeLimit; 150 | } 151 | 152 | private void timerSecondPassed (object source, ElapsedEventArgs e) { 153 | _timeCurrent -= 1; 154 | if (_timeCurrent <= 0) { 155 | timerExpired(); 156 | } 157 | } 158 | 159 | private void timerExpired () { 160 | StopTimer(); 161 | 162 | // Needs to run on the main thread 163 | UnityMainThreadDispatcher.Instance().Enqueue(() => { 164 | FailQuest(); 165 | }); 166 | } 167 | 168 | public double GetTimeRemaining () { 169 | return _timeCurrent; 170 | } 171 | 172 | public Bounds GetDestination () { 173 | return _destination; 174 | } 175 | 176 | public void CompleteQuest () { 177 | DestroyTimer(); 178 | 179 | SetStatus(QuestStatus.completed); 180 | 181 | if (OnComplete != null) { 182 | OnComplete(); 183 | } 184 | } 185 | 186 | public void FailQuest () { 187 | DestroyTimer(); 188 | 189 | SetStatus(QuestStatus.failed); 190 | 191 | if (OnFailure != null) { 192 | OnFailure(); 193 | } 194 | } 195 | 196 | private void SetParentQuest (Quest quest) { 197 | _parentQuest = quest; 198 | } 199 | 200 | public bool IsChildQuest () { 201 | return _parentQuest != null; 202 | } 203 | 204 | public void AddQuest(Quest quest) { 205 | quest.SetParentQuest(this); 206 | 207 | quest.OnStatusChange += (newStatus) => { 208 | if (OnChildStatusChange != null) { 209 | OnChildStatusChange(quest, newStatus); 210 | } 211 | }; 212 | 213 | quest.OnChildStatusChange += (childQuest, newStatus) => { 214 | if(OnChildStatusChange != null) { 215 | OnChildStatusChange(childQuest, newStatus); 216 | } 217 | }; 218 | 219 | quest.OnStatusChange += _ProcessChildQuests; 220 | 221 | _childQuests.Add(quest); 222 | } 223 | 224 | public List GetChildQuests () { 225 | return _childQuests; 226 | } 227 | 228 | public void SetNestedQuestType (NestedQuestType type) { 229 | _childQuestType = type; 230 | } 231 | 232 | public void _ProcessChildQuests (QuestStatus newStatus) { 233 | // This function is called when a child quest has its status updated 234 | if (newStatus == QuestStatus.inProgress) { 235 | // Ignore newly in-progress quests 236 | return; 237 | } 238 | 239 | if (newStatus == QuestStatus.failed) { 240 | // Well, we failed, so fail all quests and the parent 241 | foreach(Quest quest in _childQuests) { 242 | quest.FailQuest(); 243 | } 244 | 245 | FailQuest(); 246 | 247 | return; 248 | } 249 | 250 | if (newStatus != QuestStatus.completed) { 251 | // Ignore anything else that isn't completed 252 | return; 253 | } 254 | 255 | if (_childQuests.TrueForAll(quest => quest.GetStatus() == QuestStatus.completed)) { 256 | // We finished all our quests! Mark this parent quest as completed. 257 | CompleteQuest(); 258 | return; 259 | } 260 | 261 | if (_childQuestType == NestedQuestType.sequential) { 262 | for (int i = 0; i < _childQuests.Count; i++) { 263 | Quest quest = _childQuests[i]; 264 | 265 | // Last 266 | if ((i + 1) == _childQuests.Count) { 267 | break; 268 | } 269 | 270 | Quest next = _childQuests[i + 1]; 271 | 272 | if (quest.GetStatus() == QuestStatus.completed && next.GetStatus() == QuestStatus.notStarted) { 273 | next.Start(); 274 | } 275 | } 276 | } 277 | } 278 | 279 | public void Start () { 280 | SetStatus(QuestStatus.inProgress); 281 | 282 | if (HasTimeLimit()) { 283 | DestroyTimer(); 284 | _timer = new Timer(1000); 285 | _timer.Elapsed += this.timerSecondPassed; 286 | _timer.Start(); 287 | } 288 | 289 | if (_type == QuestType.nested) { 290 | if (_childQuestType == NestedQuestType.sequential) { 291 | // Just start the first quest 292 | _childQuests[0].Start(); 293 | } else if (_childQuestType == NestedQuestType.parallel) { 294 | foreach(Quest quest in _childQuests) { 295 | quest.Start(); 296 | } 297 | } 298 | } 299 | } 300 | 301 | public void AddItemToFetch (QuestItem item) { 302 | _itemsToFetch.Add(item); 303 | } 304 | 305 | public void RemoveItemToFetch (QuestItem item) { 306 | _itemsToFetch.Remove(item); 307 | } 308 | 309 | public List GetItemsToFetch () { 310 | return _itemsToFetch; 311 | } 312 | 313 | public void ItemFetched (QuestItem item) { 314 | List hasFetched = _itemsFetched.FindAll(_item => _item.id == item.id); 315 | List toFetch = _itemsToFetch.FindAll(_item => _item.id == item.id); 316 | 317 | if (toFetch.Count == 0 || hasFetched.Count < toFetch.Count) { 318 | hasFetched.Add(item); 319 | } 320 | 321 | if (toFetch.Count == hasFetched.Count) { 322 | CompleteQuest(); 323 | } 324 | } 325 | 326 | public List GetItemsFetched () { 327 | return _itemsFetched; 328 | } 329 | } 330 | } 331 | -------------------------------------------------------------------------------- /Scripts/Quest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95372da1e11c44057b0285eb287ccc81 3 | timeCreated: 1516540267 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/QuestItem.cs: -------------------------------------------------------------------------------- 1 | namespace Boxxen.Quests { 2 | public interface QuestItem { 3 | string id { get; } 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Scripts/QuestItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc1995d6298184f9e9c984af423d6502 3 | timeCreated: 1516543799 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/QuestManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | using Boxxen.Quests; 6 | 7 | public class QuestManager : MonoBehaviour { 8 | public delegate void OnNewQuestHandler(Quest quest); 9 | public event OnNewQuestHandler OnNewQuest; 10 | 11 | public delegate void OnQuestStatusChangeHandler(Quest quest, QuestStatus newStatus); 12 | public event OnQuestStatusChangeHandler OnQuestStatusChange; 13 | 14 | public delegate void OnQuestCompletionHandler(Quest quest); 15 | public event OnQuestCompletionHandler OnQuestCompletion; 16 | 17 | public delegate void OnQuestFailureHandler(Quest quest); 18 | public event OnQuestFailureHandler OnQuestFailure; 19 | 20 | private List quests = new List(); 21 | 22 | void Start () { 23 | // We need to create a new instance of UnityMainThreadDispatcher 24 | GameObject unityMainThreadDispatcherObject = GameObject.Find("__UnityMainThreadDispatcher"); 25 | if (unityMainThreadDispatcherObject == null) { 26 | unityMainThreadDispatcherObject = new GameObject("__UnityMainThreadDispatcher"); 27 | unityMainThreadDispatcherObject.AddComponent(); 28 | } 29 | 30 | } 31 | 32 | public void AddQuest (Quest quest) { 33 | quests.Add(quest); 34 | if (OnNewQuest != null) { 35 | OnNewQuest(quest); 36 | } 37 | 38 | quest.OnStatusChange += (newStatus) => _OnQuestStatusChange(quest, newStatus); 39 | quest.OnComplete += () => _OnQuestCompletion(quest); 40 | quest.OnFailure += () => _OnQuestFailure(quest); 41 | } 42 | 43 | private void _OnQuestStatusChange (Quest quest, QuestStatus newStatus) { 44 | if (OnQuestStatusChange != null) { 45 | OnQuestStatusChange(quest, newStatus); 46 | } 47 | } 48 | 49 | private void _OnQuestCompletion(Quest quest) { 50 | if (OnQuestCompletion != null) { 51 | OnQuestCompletion(quest); 52 | } 53 | } 54 | 55 | private void _OnQuestFailure(Quest quest) { 56 | if (OnQuestFailure != null) { 57 | OnQuestFailure(quest); 58 | } 59 | } 60 | 61 | public List GetQuests () { 62 | return quests; 63 | } 64 | 65 | public List GetQuests (QuestStatus filter) { 66 | return quests.FindAll(q => q.GetStatus() == filter); 67 | } 68 | 69 | public void StartTrackingLocation (float interval = 1f) { 70 | InvokeRepeating("CheckLocation", 0f, interval); 71 | } 72 | 73 | public void StopTrackingLocation () { 74 | CancelInvoke("CheckLocation"); 75 | } 76 | 77 | public void CheckLocation () { 78 | Bounds bounds = GetComponent().bounds; 79 | 80 | Renderer[] renderers = GetComponentsInChildren(); 81 | 82 | foreach(Renderer renderer in renderers) { 83 | bounds.Encapsulate(renderer.bounds); 84 | } 85 | 86 | List quests = GetQuests(QuestStatus.inProgress); 87 | 88 | foreach(Quest quest in quests) { 89 | CheckQuestLocation(quest, bounds); 90 | } 91 | } 92 | 93 | private void CheckQuestLocation (Quest quest, Bounds bounds) { 94 | if (quest.GetQuestType() == QuestType.nested) { 95 | List childQuests = quest.GetChildQuests(); 96 | foreach(Quest childQuest in childQuests) { 97 | if (childQuest.GetStatus() == QuestStatus.inProgress) { 98 | CheckQuestLocation(childQuest, bounds); 99 | } 100 | } 101 | return; 102 | } 103 | 104 | if (quest.GetDestination().Intersects(bounds)) { 105 | quest.CompleteQuest(); 106 | } 107 | } 108 | 109 | public void ItemFetched (QuestItem item) { 110 | foreach (Quest quest in quests) { 111 | quest.ItemFetched(item); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Scripts/QuestManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ec810b17f4c649568139131acc211da 3 | timeCreated: 1516540238 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /ThirdParty.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4810715b86c5c4ea8a9f80eca5977523 3 | folderAsset: yes 4 | timeCreated: 1516956072 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3815dbcdfb0646a7b3dfa0a98f6996d 3 | folderAsset: yes 4 | timeCreated: 1516956203 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 383632e636ffd447fa3a7ec19745b54d 3 | timeCreated: 1516956203 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/README.md: -------------------------------------------------------------------------------- 1 | # UnityMainThreadDispatcher 2 | 3 | A thread-safe way of dispatching IEnumerator functions to the main thread in unity. Useful for calling UI functions and other actions that Unity limits to the main thread from different threads. 4 | ### Version 5 | 1.0 - Tested and functional in one or more production mobile games (including https://get-wrecked.com) 6 | 7 | ### Installation 8 | 9 | No dependencies needed other than Unity. This script was created in Unity 5.3, and has been tested in 5.3, 5.4, and 5.5. 10 | 11 | 1. Download the UnityMainThreadDispatcher prefab and add it to your scene, or simple create an empty GameObject, call it UnityMainThreadDispatcher. 12 | 2. Download the UnityMainThreadDispatcher.cs script and add it to your prefab 13 | 3. You can now dispatch objects to the main thread in Unity. 14 | 15 | ### Usage 16 | ```C# 17 | public IEnumerator ThisWillBeExecutedOnTheMainThread() { 18 | Debug.Log ("This is executed from the main thread"); 19 | yield return null; 20 | } 21 | public void ExampleMainThreadCall() { 22 | UnityMainThreadDispatcher.Instance().Enqueue(ThisWillBeExecutedOnTheMainThread()); 23 | } 24 | ``` 25 | OR 26 | 27 | ```C# 28 | UnityMainThreadDispatcher.Instance().Enqueue(() => Debug.Log ("This is executed from the main thread")); 29 | ``` 30 | ### Development 31 | 32 | Want to contribute? Great! If you find a bug or want to make improvements, simply fork the repo and make a pull request with your changes on your own fork. 33 | 34 | ### Author 35 | @PimDeWitte 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a00d6dc36c054976984c405fdd4e6af 3 | timeCreated: 1516956206 4 | licenseType: Free 5 | TextScriptImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/UnityMainThreadDispatcher.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Pim de Witte All Rights Reserved. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | using UnityEngine; 18 | using System.Collections; 19 | using System.Collections.Generic; 20 | using System; 21 | 22 | /// Author: Pim de Witte (pimdewitte.com) and contributors 23 | /// 24 | /// A thread-safe class which holds a queue with actions to execute on the next Update() method. It can be used to make calls to the main thread for 25 | /// things such as UI Manipulation in Unity. It was developed for use in combination with the Firebase Unity plugin, which uses separate threads for event handling 26 | /// 27 | public class UnityMainThreadDispatcher : MonoBehaviour { 28 | 29 | private static readonly Queue _executionQueue = new Queue(); 30 | 31 | public void Update() { 32 | lock(_executionQueue) { 33 | while (_executionQueue.Count > 0) { 34 | _executionQueue.Dequeue().Invoke(); 35 | } 36 | } 37 | } 38 | 39 | /// 40 | /// Locks the queue and adds the IEnumerator to the queue 41 | /// 42 | /// IEnumerator function that will be executed from the main thread. 43 | public void Enqueue(IEnumerator action) { 44 | lock (_executionQueue) { 45 | _executionQueue.Enqueue (() => { 46 | StartCoroutine (action); 47 | }); 48 | } 49 | } 50 | 51 | /// 52 | /// Locks the queue and adds the Action to the queue 53 | /// 54 | /// function that will be executed from the main thread. 55 | public void Enqueue(Action action) 56 | { 57 | Enqueue(ActionWrapper(action)); 58 | } 59 | IEnumerator ActionWrapper(Action a) 60 | { 61 | a(); 62 | yield return null; 63 | } 64 | 65 | 66 | private static UnityMainThreadDispatcher _instance = null; 67 | 68 | public static bool Exists() { 69 | return _instance != null; 70 | } 71 | 72 | public static UnityMainThreadDispatcher Instance() { 73 | if (!Exists ()) { 74 | throw new Exception ("UnityMainThreadDispatcher could not find the UnityMainThreadDispatcher object. Please ensure you have added the MainThreadExecutor Prefab to your scene."); 75 | } 76 | return _instance; 77 | } 78 | 79 | 80 | void Awake() { 81 | if (_instance == null) { 82 | _instance = this; 83 | DontDestroyOnLoad(this.gameObject); 84 | } 85 | } 86 | 87 | void OnDestroy() { 88 | _instance = null; 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/UnityMainThreadDispatcher.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16173428f7358476fa784f899e396692 3 | timeCreated: 1459554404 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/UnityMainThreadDispatcher.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &184210 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 224: {fileID: 22414968} 11 | - 114: {fileID: 11464956} 12 | m_Layer: 0 13 | m_Name: UnityMainThreadDispatcher 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!114 &11464956 20 | MonoBehaviour: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 184210} 25 | m_Enabled: 1 26 | m_EditorHideFlags: 0 27 | m_Script: {fileID: 11500000, guid: 16173428f7358476fa784f899e396692, type: 3} 28 | m_Name: 29 | m_EditorClassIdentifier: 30 | --- !u!224 &22414968 31 | RectTransform: 32 | m_ObjectHideFlags: 1 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | m_GameObject: {fileID: 184210} 36 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 37 | m_LocalPosition: {x: 0, y: 0, z: 0} 38 | m_LocalScale: {x: 0, y: 0, z: 0} 39 | m_Children: [] 40 | m_Father: {fileID: 0} 41 | m_RootOrder: 0 42 | m_AnchorMin: {x: 0.5, y: 0.5} 43 | m_AnchorMax: {x: 0.5, y: 0.5} 44 | m_AnchoredPosition: {x: -50, y: -50} 45 | m_SizeDelta: {x: 100, y: 100} 46 | m_Pivot: {x: 0, y: 0} 47 | --- !u!1001 &100100000 48 | Prefab: 49 | m_ObjectHideFlags: 1 50 | serializedVersion: 2 51 | m_Modification: 52 | m_TransformParent: {fileID: 0} 53 | m_Modifications: [] 54 | m_RemovedComponents: [] 55 | m_ParentPrefab: {fileID: 0} 56 | m_RootGameObject: {fileID: 184210} 57 | m_IsPrefabParent: 1 58 | -------------------------------------------------------------------------------- /ThirdParty/UnityMainThreadDispatcher/UnityMainThreadDispatcher.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a749df5e56f6422ba9fe64d83915a89 3 | timeCreated: 1459554642 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | --------------------------------------------------------------------------------