Пример #1
0
        public void SetupScriptableObjects(SystemDataFactory systemDataFactory)
        {
            item = null;
            if (itemName != null)
            {
                Item tmpItem = systemDataFactory.GetResource <Item>(itemName);
                if (tmpItem != null)
                {
                    item = tmpItem;
                }
                else
                {
                    Debug.LogError("SystemSkillManager.SetupScriptableObjects(): Could not find item : " + itemName + " while inititalizing a vendor item.  CHECK INSPECTOR");
                }
            }

            itemQuality = null;
            if (itemQualityName != null && itemQualityName != string.Empty)
            {
                ItemQuality tmpItemQuality = systemDataFactory.GetResource <ItemQuality>(itemQualityName);
                if (tmpItemQuality != null)
                {
                    itemQuality = tmpItemQuality;
                }
                else
                {
                    Debug.LogError("SystemSkillManager.SetupScriptableObjects(): Could not find item : " + itemName + " while inititalizing a vendor item.  CHECK INSPECTOR");
                }
            }
        }
Пример #2
0
        public void SetupScriptableObjects()
        {
            if (prerequisiteConditions != null)
            {
                foreach (PrerequisiteConditions tmpPrerequisiteConditions in prerequisiteConditions)
                {
                    if (tmpPrerequisiteConditions != null)
                    {
                        //Debug.Log(gameObject.name + ".SetupScriptableObjects(): setting up prerequisites");
                        tmpPrerequisiteConditions.SetupScriptableObjects(systemGameManager, this);

                        // add this so unit spawn nodes can have their prerequisites properly set on the first check
                        tmpPrerequisiteConditions.UpdatePrerequisites(false);
                    }
                }
            }

            unitProfiles = new List <UnitProfile>();
            if (unitProfileNames != null)
            {
                foreach (string unitProfileName in unitProfileNames)
                {
                    if (unitProfileName != null && unitProfileName != string.Empty)
                    {
                        UnitProfile unitProfile = systemDataFactory.GetResource <UnitProfile>(unitProfileName);
                        if (unitProfile != null)
                        {
                            unitProfiles.Add(unitProfile);
                        }
                        else
                        {
                            Debug.LogError(gameObject.name + ": Unit Profile: " + unitProfileName + " not found while initializing Unit Unit Spawn Node.  Check Inspector!");
                        }
                    }
                }
            }

            if (unitToughness == null && defaultToughness != null && defaultToughness != string.Empty)
            {
                UnitToughness tmpToughness = systemDataFactory.GetResource <UnitToughness>(defaultToughness);
                if (tmpToughness != null)
                {
                    unitToughness = tmpToughness;
                }
                else
                {
                    Debug.LogError("Unit Toughness: " + defaultToughness + " not found while initializing Unit Profiles.  Check Inspector!");
                }
            }
        }
Пример #3
0
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     prerequisiteQuest = null;
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         Quest tmpPrerequisiteQuest = systemDataFactory.GetResource <Quest>(prerequisiteName);
         if (tmpPrerequisiteQuest != null)
         {
             //Debug.Log("QuestPrerequisite.SetupScriptableObjects(): setting: " + prerequisiteName + " while inititalizing a quest prerequisite.");
             prerequisiteQuest = tmpPrerequisiteQuest;
         }
         else
         {
             Debug.LogError("QuestPrerequisite.SetupScriptableObjects(): Could not find quest : " + prerequisiteName + " while inititalizing a quest prerequisite.  CHECK INSPECTOR");
         }
     }
     else
     {
         Debug.LogError("QuestPrerequisite.SetupScriptableObjects(): prerequisiteName was empty while inititalizing a quest prerequisite.  CHECK INSPECTOR");
     }
     if (prerequisiteQuest != null)
     {
         prerequisiteQuest.OnQuestStatusUpdated          += HandleQuestStatusUpdated;
         prerequisiteQuest.OnQuestObjectiveStatusUpdated += HandleQuestStatusUpdated;
     }
 }
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         prerequisiteFaction = systemDataFactory.GetResource <Faction>(prerequisiteName);
     }
     else
     {
         Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find dialog : " + prerequisiteName + " while inititalizing a dialog prerequisite.  CHECK INSPECTOR");
     }
     SystemEventManager.StartListening("OnReputationChange", HandleReputationChange);
 }
Пример #5
0
        public void SetupScriptableObjects(SystemGameManager systemGameManager)
        {
            //Debug.Log("CharacterClassPrerequisite.SetupScriptableObjects(" + (systemGameManager == null ? "null" : systemGameManager.gameObject.name) + ")");

            Configure(systemGameManager);
            prerequisiteCharacterClass = null;
            if (requiredCharacterClass != null && requiredCharacterClass != string.Empty)
            {
                prerequisiteCharacterClass = systemDataFactory.GetResource <CharacterClass>(requiredCharacterClass);
            }
            else
            {
                Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find character class : " + prerequisiteCharacterClass + " while inititalizing a character class prerequisite.  CHECK INSPECTOR");
            }

            systemEventManager.OnClassChange += HandleClassChange;
        }
Пример #6
0
 /// <summary>
 /// Get a new copy of an item based on the factory template.  This is necessary so items can be deleted without deleting the entire item from the database
 /// </summary>
 /// <param name="resourceName"></param>
 /// <returns></returns>
 public Item GetNewResource(string resourceName, ItemQuality usedItemQuality = null)
 {
     //Debug.Log(this.GetType().Name + ".GetNewResource(" + resourceName + ")");
     if (!SystemDataFactory.RequestIsEmpty(resourceName))
     {
         string keyName      = SystemDataFactory.PrepareStringForMatch(resourceName);
         Item   itemTemplate = systemDataFactory.GetResource <Item>(keyName);
         if (itemTemplate != null)
         {
             Item returnValue = ScriptableObject.Instantiate(itemTemplate) as Item;
             returnValue.SetupScriptableObjects(systemGameManager);
             returnValue.InitializeNewItem(usedItemQuality);
             return(returnValue);
         }
     }
     return(null);
 }
Пример #7
0
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     prerequisiteAbility = null;
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         prerequisiteAbility = systemDataFactory.GetResource <BaseAbility>(prerequisiteName);
         if (prerequisiteAbility != null)
         {
             prerequisiteAbility.OnAbilityLearn += HandleAbilityListChanged;
         }
     }
     else
     {
         Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find ability : " + prerequisiteName + " while inititalizing a prerequisite.  CHECK INSPECTOR");
     }
 }
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     prerequisiteSkill = null;
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         Skill tmpPrerequisiteSkill = systemDataFactory.GetResource <Skill>(prerequisiteName);
         if (tmpPrerequisiteSkill != null)
         {
             prerequisiteSkill = tmpPrerequisiteSkill;
         }
         else
         {
             Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find skill : " + prerequisiteName + " while inititalizing a prerequisite.  CHECK INSPECTOR");
         }
     }
     systemEventManager.OnSkillListChanged += HandleSkillListChanged;
 }
        public override void SetupScriptableObjects(SystemGameManager systemGameManager)
        {
            base.SetupScriptableObjects(systemGameManager);

            // get the description profile if it exists, and then overwrite any local properties that are not null in that profile
            resourceDescription = null;
            if (useRegionalDescription == true)
            {
                resourceDescriptionProfile = DisplayName;
            }
            if (resourceDescriptionProfile != null && resourceDescriptionProfile != string.Empty)
            {
                ResourceDescription tmpResourceDescription = systemDataFactory.GetResource <ResourceDescription>(resourceDescriptionProfile);
                if (tmpResourceDescription != null)
                {
                    if (tmpResourceDescription.RawDisplayName != null && tmpResourceDescription.RawDisplayName != string.Empty)
                    {
                        //Debug.Log("setting resource name to: " + tmpResourceDescription.MyDisplayName);
                        displayName = tmpResourceDescription.RawDisplayName;
                    }
                    if (tmpResourceDescription.Icon != null)
                    {
                        icon = tmpResourceDescription.Icon;
                    }
                    if (tmpResourceDescription.IconBackgroundImage != null)
                    {
                        iconBackgroundImage = tmpResourceDescription.IconBackgroundImage;
                    }
                    if (tmpResourceDescription.Description != null && tmpResourceDescription.Description != string.Empty)
                    {
                        description = tmpResourceDescription.Description;
                    }
                }
                else
                {
                    if (optionalOverride == false)
                    {
                        Debug.LogError("DescribableResource.SetupScriptableObjects(): Could Not Find " + resourceDescriptionProfile + " resource description while processing " + DisplayName + ". CHECK INSPECTOR!");
                    }
                }
            }
        }
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     prerequisiteSceneNode = null;
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         SceneNode tmpPrerequisiteSceneNode = systemDataFactory.GetResource <SceneNode>(prerequisiteName);
         if (tmpPrerequisiteSceneNode != null)
         {
             prerequisiteSceneNode = tmpPrerequisiteSceneNode;
         }
         else
         {
             Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): Could not find scene node : " + prerequisiteName + " while inititalizing a visit zone prerequisite.  CHECK INSPECTOR");
         }
     }
     else
     {
         Debug.LogError("SystemAbilityManager.SetupScriptableObjects(): prerequisite empty while inititalizing a visit zone prerequisite.  CHECK INSPECTOR");
     }
     prerequisiteSceneNode.OnVisitZone += HandleSceneNodeVisisted;
 }
Пример #11
0
 public void SetupScriptableObjects(SystemGameManager systemGameManager)
 {
     Configure(systemGameManager);
     prerequisiteDialog = null;
     if (prerequisiteName != null && prerequisiteName != string.Empty)
     {
         Dialog tmpDialog = systemDataFactory.GetResource <Dialog>(prerequisiteName);
         if (tmpDialog != null)
         {
             prerequisiteDialog = tmpDialog;
             prerequisiteDialog.OnDialogCompleted += HandleDialogCompleted;
         }
         else
         {
             Debug.LogError("DialogPrerequisite.SetupScriptableObjects(): Could not find dialog : " + prerequisiteName + " while inititalizing a dialog prerequisite.  CHECK INSPECTOR");
         }
     }
     else
     {
         Debug.LogError("DialogPrerequisite.SetupScriptableObjects(): no prerequisite was defined while inititalizing a dialog prerequisite.  CHECK INSPECTOR");
     }
 }