Exemple #1
0
        /// <summary>
        /// 新增任务点
        /// </summary>
        private void AddPoint(Type type, Vector2 position)
        {
            TaskPointAttribute tpa       = type.GetCustomAttribute <TaskPointAttribute>();
            TaskPointBase      taskPoint = CreateInstance(type) as TaskPointBase;

            taskPoint.Anchor        = new Rect(position.x, position.y, 200, 85);
            taskPoint.GUID          = _asset.TaskPointIDName + _asset.TaskPointIDSign.ToString();
            taskPoint.Name          = (tpa != null ? tpa.GetLastName() : "New Task Point ") + _asset.TaskPointIDSign.ToString();
            _asset.TaskPointIDSign += 1;
            _currentContent.Points.Add(taskPoint);

            TaskContentBase.GenerateSerializeSubObject(taskPoint, _asset);
        }
Exemple #2
0
        /// <summary>
        /// 新增任务点
        /// </summary>
        private void AddPoint(TaskContentBase content, Type type, Vector2 pos)
        {
            TaskPointAttribute attribute = type.GetCustomAttribute <TaskPointAttribute>();
            TaskPointBase      taskPoint = CreateInstance(type) as TaskPointBase;

            taskPoint.Anchor = new Rect(pos.x, pos.y, 0, 0);
            taskPoint.GUID   = _contentAsset.TaskPointIDName + _contentAsset.TaskPointIDSign.ToString();
            taskPoint.Name   = (attribute != null ? attribute.GetLastName() : "New Task Point ") + _contentAsset.TaskPointIDSign.ToString();
            _contentAsset.TaskPointIDSign += 1;
            content.Points.Add(taskPoint);

            TaskContentAsset.GenerateSerializeSubObject(taskPoint, _contentAsset);
        }