Ejemplo n.º 1
0
        public object GetVerifiableParameters()
        {
            ExportedQuestTask exportedQuestTask = new ExportedQuestTask();

            exportedQuestTask.zone       = Zone.ZoneName;
            exportedQuestTask.threshold  = Threshold;
            exportedQuestTask.comparison = (int)Comparison;
            exportedQuestTask.watchers   = new List <ExportedTaskWatcher>();
            for (int i = 0; i < Watchers.Length; i++)
            {
                TaskWatcher         taskWatcher         = Watchers[i];
                ExportedTaskWatcher exportedTaskWatcher = new ExportedTaskWatcher();
                if (!string.IsNullOrEmpty(taskWatcher.CriteriaSwitchName))
                {
                    GameObject gameObject = GameObject.Find(taskWatcher.CriteriaSwitchName);
                    if (gameObject == null)
                    {
                        Disney.LaunchPadFramework.Log.LogError(this, "Unable to find switch criteria object " + taskWatcher.CriteriaSwitchName + ". Will not be exported");
                        continue;
                    }
                    Switch component = gameObject.GetComponent <Switch>();
                    exportedTaskWatcher.criteriaSwitch = ExportedSwitch.Create(component);
                }
                exportedTaskWatcher.type       = taskWatcher.GetWatcherType();
                exportedTaskWatcher.parameters = taskWatcher.GetExportParameters();
                exportedQuestTask.watchers.Add(exportedTaskWatcher);
            }
            return(exportedQuestTask);
        }
Ejemplo n.º 2
0
    private ExportedTaskWatcher exportTaskWatcher(TaskWatcher watcherDef)
    {
        ExportedTaskWatcher exportedTaskWatcher = new ExportedTaskWatcher();

        if (!string.IsNullOrEmpty(watcherDef.CriteriaSwitchName))
        {
            GameObject gameObject = GameObject.Find(watcherDef.CriteriaSwitchName);
            if (gameObject == null)
            {
                Log.LogError(this, "Unable to find switch criteria object " + watcherDef.CriteriaSwitchName + " for WatcherSwitch " + base.name + ". Will not be exported");
                return(null);
            }
            Switch component = gameObject.GetComponent <Switch>();
            exportedTaskWatcher.criteriaSwitch = ExportedSwitch.Create(component);
        }
        exportedTaskWatcher.type       = watcherDef.GetWatcherType();
        exportedTaskWatcher.parameters = watcherDef.GetExportParameters();
        return(exportedTaskWatcher);
    }