养成基本完毕,新UI,修bug,装备初步,
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CartoonUI
|
||||
{
|
||||
public class Close : MonoBehaviour
|
||||
{
|
||||
public GameObject gameObject;
|
||||
public void close()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5dba672f501cb34d933fc738f3f12c8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 225102
|
||||
packageName: Simple Cartoon UI
|
||||
packageVersion: 1.1
|
||||
assetPath: Assets/Cartoon UI/Script/Close.cs
|
||||
uploadId: 825882
|
||||
@@ -0,0 +1,70 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
namespace Controls
|
||||
{
|
||||
public class MainControls : MonoBehaviour
|
||||
{
|
||||
public GameObject Store;
|
||||
public GameObject Ranking;
|
||||
public GameObject Mail;
|
||||
public GameObject Settings;
|
||||
public GameObject Lose;
|
||||
public GameObject Victory;
|
||||
public GameObject Mission;
|
||||
public GameObject DailyRewards;
|
||||
public GameObject SelectLevel;
|
||||
|
||||
|
||||
public Button StoreBtn;
|
||||
public Button RankingBtn;
|
||||
public Button DailyRewardsBtn;
|
||||
public Button MailBtn;
|
||||
public Button SettingsBtn;
|
||||
public Button MissionBtn;
|
||||
public Button SelectLevelBtn;
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
StoreBtn.onClick.AddListener(OpenStore);
|
||||
RankingBtn.onClick.AddListener(OpenRanking);
|
||||
DailyRewardsBtn.onClick.AddListener(OpenDailyRewards);
|
||||
MailBtn.onClick.AddListener(OpenMail);
|
||||
SettingsBtn.onClick.AddListener(OpenSettings);
|
||||
MissionBtn.onClick.AddListener(OpenMission);
|
||||
SelectLevelBtn.onClick.AddListener(OpenLevelSelect);
|
||||
}
|
||||
|
||||
void OpenStore()
|
||||
{
|
||||
Store.SetActive(true);
|
||||
}
|
||||
void OpenMail()
|
||||
{
|
||||
Mail.SetActive(true);
|
||||
}
|
||||
void OpenDailyRewards()
|
||||
{
|
||||
DailyRewards.SetActive(true);
|
||||
}
|
||||
void OpenRanking()
|
||||
{
|
||||
Ranking.SetActive(true);
|
||||
}
|
||||
void OpenSettings()
|
||||
{
|
||||
Settings.SetActive(true);
|
||||
}
|
||||
void OpenMission()
|
||||
{
|
||||
Mission.SetActive(true);
|
||||
}
|
||||
|
||||
void OpenLevelSelect()
|
||||
{
|
||||
SelectLevel.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 816fc23eafee75549bb184e13f6951ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 225102
|
||||
packageName: Simple Cartoon UI
|
||||
packageVersion: 1.1
|
||||
assetPath: Assets/Cartoon UI/Script/MainControls.cs
|
||||
uploadId: 825882
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
namespace Store
|
||||
{
|
||||
public class StoreScript : MonoBehaviour
|
||||
{
|
||||
public Button Gems;
|
||||
public Button Coins;
|
||||
public GameObject Gems_On;
|
||||
public GameObject Gems_Off;
|
||||
public GameObject Coins_On;
|
||||
public GameObject Coins_Off;
|
||||
[Space(10)]
|
||||
|
||||
public GameObject GemView;
|
||||
public GameObject CoinView;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Gems_On.SetActive(true);
|
||||
Gems_Off.SetActive(false);
|
||||
Coins_Off.SetActive(true);
|
||||
Coins_On.SetActive(false);
|
||||
Gems.onClick.AddListener(gemsClick);
|
||||
Coins.onClick.AddListener(coinsClick);
|
||||
GemView.SetActive(true);
|
||||
CoinView.SetActive(false);
|
||||
}
|
||||
|
||||
void gemsClick()
|
||||
{
|
||||
Switch("gems");
|
||||
}
|
||||
|
||||
void coinsClick()
|
||||
{
|
||||
Switch("coins");
|
||||
}
|
||||
public void Switch(string name)
|
||||
{
|
||||
if (name == "gems")
|
||||
{
|
||||
Gems_On.SetActive(true);
|
||||
Gems_Off.SetActive(false);
|
||||
Coins_Off.SetActive(true);
|
||||
Coins_On.SetActive(false);
|
||||
GemView.SetActive(true);
|
||||
CoinView.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Gems_On.SetActive(false);
|
||||
Gems_Off.SetActive(true);
|
||||
Coins_Off.SetActive(false);
|
||||
Coins_On.SetActive(true);
|
||||
GemView.SetActive(false);
|
||||
CoinView.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bffc523cf7b2614980bb718a0a0a175
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 225102
|
||||
packageName: Simple Cartoon UI
|
||||
packageVersion: 1.1
|
||||
assetPath: Assets/Cartoon UI/Script/StoreScript.cs
|
||||
uploadId: 825882
|
||||
Reference in New Issue
Block a user