更新,spine和很多优化
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Bansonic;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class dailyTaskManager : MonoBehaviour
|
||||
{
|
||||
[Header("任务池so")]
|
||||
public userTasksPool taskPool;
|
||||
|
||||
[Header("今日进度")]
|
||||
public Slider todayProgressSlider;
|
||||
public Text todayProgressPercent;
|
||||
public Text todayProgressText;
|
||||
public Text notasksanymore;
|
||||
|
||||
|
||||
[Header("一键领取")]
|
||||
public Button oneKeyRewardBtn;
|
||||
|
||||
[Header("任务配置")]
|
||||
[Tooltip("任务列表最大容量")]
|
||||
public int taskMaxSize = 5;
|
||||
[Tooltip("最大刷新次数")]
|
||||
public int refreshMaxTimes = 3;
|
||||
|
||||
[Header("prefabs")]
|
||||
public GameObject dailyTaskItemPrefab;
|
||||
public Transform dailyTaskItemParent;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ecefd7c8457464442841611a7685b465
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0085dcf7ad7586b49bf0297452d44020
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e466864f7f62639409ff977964559aba, type: 3}
|
||||
m_Name: 10100_usertasks
|
||||
m_EditorClassIdentifier:
|
||||
tasks:
|
||||
- taskID: 10101
|
||||
description: "\u767B\u5F55\u6E38\u620F"
|
||||
taskType: 0
|
||||
refreshFrequency: 1
|
||||
targetValue: 1
|
||||
rewardType: 0
|
||||
rewardAmount: 0
|
||||
addToTaskPool: 1
|
||||
- taskID: 10102
|
||||
description: "\u5B8C\u62103\u9996\u6B4C\u66F2"
|
||||
taskType: 1
|
||||
refreshFrequency: 1
|
||||
targetValue: 3
|
||||
rewardType: 0
|
||||
rewardAmount: 0
|
||||
addToTaskPool: 1
|
||||
- taskID: 10103
|
||||
description: "\u5B8C\u6210\u4E00\u6B2199\u8FDE\u51FB"
|
||||
taskType: 2
|
||||
refreshFrequency: 1
|
||||
targetValue: 99
|
||||
rewardType: 0
|
||||
rewardAmount: 0
|
||||
addToTaskPool: 1
|
||||
- taskID: 10104
|
||||
description: "\u8FBE\u5230\u4E00\u6B21\u603B\u52061000000"
|
||||
taskType: 3
|
||||
refreshFrequency: 1
|
||||
targetValue: 1000000
|
||||
rewardType: 0
|
||||
rewardAmount: 0
|
||||
addToTaskPool: 1
|
||||
- taskID: 10105
|
||||
description: "\u4F7F\u7528\u4E00\u6B21\u9644\u9B54\u4E4B\u74F6"
|
||||
taskType: 5
|
||||
refreshFrequency: 1
|
||||
targetValue: 1
|
||||
rewardType: 0
|
||||
rewardAmount: 0
|
||||
addToTaskPool: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b13eed1a8b291e54b9a402f5da3c97d0
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,66 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CreateAssetMenu(fileName = "NewUserTasksPool", menuName = "DailyTask/UserTasksPool")]
|
||||
public class userTasksPool : ScriptableObject
|
||||
{
|
||||
[Header("Task Definitions")]
|
||||
public List<TaskDefinition> tasks = new List<TaskDefinition>();
|
||||
|
||||
[System.Serializable]
|
||||
public class TaskDefinition
|
||||
{
|
||||
|
||||
[Tooltip("Unique identifier for the task")]
|
||||
public string taskID;
|
||||
|
||||
[Tooltip("Description of the task shown to the user")]
|
||||
[TextArea(2, 4)]
|
||||
public string description;
|
||||
|
||||
[Tooltip("Type of the task logic")]
|
||||
public TaskType taskType;
|
||||
|
||||
[Tooltip("How often the task refreshes")]
|
||||
public RefreshFrequency refreshFrequency;
|
||||
|
||||
[Tooltip("Target value to complete the task (e.g., 100 combo, 3 songs)")]
|
||||
public float targetValue;
|
||||
|
||||
[Tooltip("Type of reward given upon completion")]
|
||||
public RewardType rewardType;
|
||||
|
||||
[Tooltip("Quantity of the reward")]
|
||||
public int rewardAmount;
|
||||
|
||||
[Tooltip("是否加入任务池")]
|
||||
public bool addToTaskPool = true;
|
||||
|
||||
}
|
||||
|
||||
public enum TaskType
|
||||
{
|
||||
Login,
|
||||
PlaySong,
|
||||
FullCombo,
|
||||
TotalScore,
|
||||
WatchStory,
|
||||
UseItem,
|
||||
ShareGame
|
||||
}
|
||||
|
||||
public enum RewardType
|
||||
{
|
||||
player_money,
|
||||
player_material,
|
||||
bottleOfEXP,
|
||||
playerEXP
|
||||
}
|
||||
|
||||
public enum RefreshFrequency
|
||||
{
|
||||
OnLogin,
|
||||
DailyReset,
|
||||
Never
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e466864f7f62639409ff977964559aba
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0b13cace4a3dfa459bf21f60dff3396
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class taskPrefabController : MonoBehaviour
|
||||
{
|
||||
[Header("basic infos")]
|
||||
public TextMeshProUGUI taskNumber;
|
||||
public Text taskText;
|
||||
public Image taskProgress_fillAmount_img;
|
||||
|
||||
[Header("the rewards")]
|
||||
public Button rewardButton;
|
||||
public Image rewardImg;
|
||||
public Text rewardAmmount;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 388558abf6ff0334287c5b37f52f3185
|
||||
Reference in New Issue
Block a user