/// <summary>
        /// constructor taking a serializable task
        /// </summary>
        public Task(TaskList tl, SerializableTask task)
        {
            TaskDelay   = task.TaskDelay;
            TaskList    = tl;
            GameObject  = task.GameObject;
            TaskName    = task.TaskName;
            Description = task.Description;
            GOName      = task.GOName;

            foreach (var taskEvent in task.TaskEvents)
            {
                switch (taskEvent.TypeName)
                {
                case "TransformTaskEvent":
                {
                    TaskEvent newTaskEvent = new TransformTaskEvent(taskEvent);
                    newTaskEvent.Task = this;
                    this.TaskEvents.Add(newTaskEvent);
                }
                break;

                case "AnimationTaskEvent":
                {
                    TaskEvent newTaskEvent = new AnimationTaskEvent(taskEvent);
                    newTaskEvent.Task = this;
                    this.TaskEvents.Add(newTaskEvent);
                }
                break;
                }
            }
        }
 /// <summary>
 /// constructor taking a serializable task
 /// </summary>
 public MovingTask(TaskList tl, SerializableTask task) : base(tl, task)
 {
     Position      = task.Position;
     Rotation      = task.Rotation;
     SnapThreshold = task.SnapThreshold;
     MoveType      = task.MoveType;
 }
        /// <summary>
        /// constructor taking a serializable task
        /// </summary>
        public Task(TaskList tl, SerializableTask task)
        {
            TaskList    = tl;
            GameObject  = task.GameObject;
            TaskName    = task.TaskName;
            Description = task.Description;
            GOName      = task.GOName;

            SerializableTaskEvent ste = task.TaskEvent;

            if (ste != null)
            {
                switch (ste.TypeName)
                {
                case "TransformTaskEvent":
                {
                    TaskEvent = new TransformTaskEvent(ste);
                }
                break;
                }

                if (TaskEvent != null)
                {
                    TaskEvent.Task = this;
                }
            }
        }
        /// <summary>
        /// create a task from a serializable task
        /// </summary>
        public Task ReadTaskFromSerializedTask(SerializableTask st)
        {
            switch (st.TypeName)
            {
            case "MovingTask":
            {
                return(new MovingTask(this, st));
            }

            case "ClickingTask":
            {
                return(new ClickingTask(this, st));
            }

            default:
            {
                return(new Task(this, st));
            }
            }
        }
Beispiel #5
0
 /// <summary>
 /// constructor taking a serializable task
 /// </summary>
 public ClickingTask(TaskList tl, SerializableTask task) : base(tl, task)
 {
 }