fix:1、添加项目。2、基本箭头生成
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using ChillConnect;
|
||||
using Roy;
|
||||
using SGModule.DataStorage;
|
||||
using SGModule.NetKit;
|
||||
|
||||
public static partial class DataMgr {
|
||||
public static void InitPreferences(string jsonStr) {
|
||||
DataManager.Instance.AddSaveCallback(CloudDataSaver.UpdateData);
|
||||
var loginModel = LoginKit.Instance.LoginModel;
|
||||
|
||||
// Debug.Log($"barry init Preferences-----0--{loginModel.uid}--{userID}");
|
||||
if (loginModel.NewPlayer || loginModel.Uid != UserID.Value) {
|
||||
// Debug.Log($"barry init Preferences----1---");
|
||||
|
||||
DataManager.Instance.ClearAllData();
|
||||
UserID.Value = loginModel.Uid;
|
||||
GameHelper.InitNewWatchCDList(true);
|
||||
}
|
||||
|
||||
GameHelper.InitNewWatchCDList();
|
||||
// ObjectExtensionsTest.AsTestRun();
|
||||
|
||||
// Debug.Log($"barry init Preferences----2---{jsomnStr}");
|
||||
DataManager.Instance.ImportFromJson(jsonStr, loginModel.PlayDataVer);
|
||||
|
||||
// UserCoreMgr.Instance.LoadItemData();
|
||||
// ItemManager.GetInstance.LoadItemData();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6954de03a38b74933a35b7e181ef09bc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,200 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
using System;
|
||||
using FairyGUI;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
public class FXManager : BaseUnityManager<FXManager>
|
||||
{
|
||||
private string fxPath = "Effect/sys/";
|
||||
|
||||
FXPool<Fx_Type> fx_ObjMonoObjPool;
|
||||
|
||||
private Transform goWrapperPar;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
GameObject obj = new GameObject("FX_Pool");
|
||||
obj.transform.parent = transform;
|
||||
obj.transform.localPosition = Vector3.zero;
|
||||
obj.transform.localEulerAngles = Vector3.zero;
|
||||
fx_ObjMonoObjPool = new FXPool<Fx_Type>(obj.transform);
|
||||
fx_ObjMonoObjPool.NewObjFunc = NewObjFunc;
|
||||
fx_ObjMonoObjPool.GetObjFunc = GetObjFunc;
|
||||
fx_ObjMonoObjPool.RecObjFunc = RecObjFunc;
|
||||
}
|
||||
|
||||
private void RecObjFunc(Fx_Type arg1, Object arg2)
|
||||
{
|
||||
var componet = arg2 as Component;
|
||||
if (componet)
|
||||
componet.gameObject.SetActive(false);
|
||||
else
|
||||
{
|
||||
(arg2 as GameObject).SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void GetObjFunc(Fx_Type arg1, Object arg2)
|
||||
{
|
||||
var componet = arg2 as Component;
|
||||
if (componet)
|
||||
componet.gameObject.SetActive(true);
|
||||
else
|
||||
{
|
||||
(arg2 as GameObject).SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Object NewObjFunc(Fx_Type arg)
|
||||
{
|
||||
if ((int)arg < 100)
|
||||
{
|
||||
var go = LoadKit.Instance.LoadGameObjectAndCloneSync("Effect.spine." + arg, arg.ToString());
|
||||
SkeletonAnimation sk = go.GetComponent<SkeletonAnimation>();
|
||||
|
||||
return sk;
|
||||
}
|
||||
else
|
||||
{
|
||||
fxPath = "Effect.sys." + arg;
|
||||
var go = LoadKit.Instance.LoadGameObjectAndCloneSync(fxPath, arg.ToString());
|
||||
|
||||
|
||||
ParticleSystem particleSystem = go.GetComponent<ParticleSystem>();
|
||||
if (particleSystem == null)
|
||||
{
|
||||
particleSystem = go.GetComponentInChildren<ParticleSystem>();
|
||||
}
|
||||
|
||||
if (particleSystem != null)
|
||||
{
|
||||
foreach (var item in particleSystem.GetComponentsInChildren<ParticleSystem>())
|
||||
{
|
||||
var main = item.main;
|
||||
main.scalingMode = ParticleSystemScalingMode.Hierarchy;
|
||||
}
|
||||
|
||||
particleSystem.transform.localScale = Vector3.one * 100;
|
||||
return particleSystem;
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
}
|
||||
|
||||
public T GetFx<T>(Fx_Type fx_Type) where T : Object
|
||||
{
|
||||
T obj = fx_ObjMonoObjPool.GetObject<T>(fx_Type);
|
||||
SkeletonAnimation ani = obj as SkeletonAnimation;
|
||||
if (ani != null)
|
||||
{
|
||||
ani.gameObject.layer = 0;
|
||||
ani.ClearState();
|
||||
ani.transform.localPosition = Vector3.zero;
|
||||
ani.transform.localEulerAngles = Vector3.zero;
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
public void RecFx<T>(Fx_Type fx_Type, T obj) where T : Object
|
||||
{
|
||||
fx_ObjMonoObjPool.RecObject(fx_Type, obj);
|
||||
}
|
||||
|
||||
public List<GameObject> gameObjects = new List<GameObject>();
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
fx_ObjMonoObjPool.Dispose();
|
||||
}
|
||||
|
||||
private Queue<GoWrapper> goWrapperQueue = new Queue<GoWrapper>();
|
||||
|
||||
public T SetFx<T>(GGraph gp, Fx_Type fx_Type, ref Action Rec) where T : Component
|
||||
{
|
||||
var fx = GetFx<T>(fx_Type);
|
||||
if (fx != null)
|
||||
{
|
||||
var goWrapper = new GoWrapper(fx.gameObject);
|
||||
gp.SetNativeObject(goWrapper);
|
||||
fx.transform.localPosition = Vector3.zero;
|
||||
fx.transform.localScale = Vector3.one * 100;
|
||||
fx.transform.localEulerAngles = Vector3.zero;
|
||||
Rec += () =>
|
||||
{
|
||||
goWrapper.wrapTarget = null;
|
||||
gp.SetNativeObject(null);
|
||||
RecFx(fx_Type, fx);
|
||||
};
|
||||
}
|
||||
|
||||
return fx;
|
||||
}
|
||||
|
||||
public GameObject SetFx(GGraph gp, Fx_Type fx_Type, ref Action Rec, bool supportStencil = false)
|
||||
{
|
||||
GameObject fx = GetFx<GameObject>(fx_Type);
|
||||
if (fx != null)
|
||||
{
|
||||
var goWrapper = new GoWrapper(fx.gameObject);
|
||||
gp.SetNativeObject(goWrapper);
|
||||
fx.transform.localPosition = Vector3.zero;
|
||||
fx.transform.localScale = Vector3.one * 100;
|
||||
fx.transform.localEulerAngles = Vector3.zero;
|
||||
Rec += () =>
|
||||
{
|
||||
goWrapper.wrapTarget = null;
|
||||
gp.SetNativeObject(null);
|
||||
RecFx(fx_Type, fx);
|
||||
};
|
||||
}
|
||||
|
||||
return fx;
|
||||
}
|
||||
}
|
||||
|
||||
public enum Fx_Type
|
||||
{
|
||||
None = -1,
|
||||
gamwin,
|
||||
fx_broad,
|
||||
fx_login_light,
|
||||
fx_login_bird,
|
||||
fx_coin,
|
||||
fx_hand_pre,
|
||||
fx_disaappear_1,
|
||||
fx_disaappear_2,
|
||||
fx_first_reward,
|
||||
fx_egg,
|
||||
fx_egg_light,
|
||||
fx_gift_bg,
|
||||
fx_lock_light,
|
||||
fx_removeAD,
|
||||
fx_removeAD_bg,
|
||||
fx_saving,
|
||||
fx_sign1,
|
||||
fx_lock,
|
||||
fx_open,
|
||||
fx_lose,
|
||||
fx_three_gift,
|
||||
fx_petty_reward,
|
||||
fx_tips,
|
||||
fx_wheel,
|
||||
fx_win,
|
||||
fx_winstar,
|
||||
fx_proplight,
|
||||
fx_addeffect,
|
||||
fx_addeffect_1,
|
||||
fx_free_idle = 104,
|
||||
fx_ui_jinbi_click = 107,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9cde96b619c044d99e1f59d178df68cd
|
||||
timeCreated: 1681806251
|
||||
@@ -0,0 +1,242 @@
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using SGModule.Net;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using FairyGUI;
|
||||
using SGModule.ApplePay;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.NetKit;
|
||||
using Assets.Scripts;
|
||||
using SGModule.Common;
|
||||
|
||||
public class HallManager : BaseUnityManager<HallManager>
|
||||
{
|
||||
public event Action UpdateSecondEvent;
|
||||
public event Action UpdateFiveSecondEvent;
|
||||
|
||||
private float _secondTime;
|
||||
private float _secondTime1;
|
||||
private LoginModel loginModel;
|
||||
private bool isGameStart;
|
||||
private GameDataSystem gameDataSys;
|
||||
private WindowSystem windowSys;
|
||||
private RewardSystem rewardSys;
|
||||
private ConsumeSystem consumeSys;
|
||||
|
||||
private bool isFirstEnter = true;
|
||||
public int enterHallTimes = 0;
|
||||
public bool isShowRankView = false;
|
||||
public event Action UpdateEvent;
|
||||
|
||||
|
||||
// public int countTimes = 0;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
CtrlDispatcher.Instance.AddListener(CtrlMsg.Game_Start, OnGameStart);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.OpenGame, EnterGame);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.BackMainScene, EnterHall);
|
||||
|
||||
AppDispatcher.Instance.AddListener(MainThreadMsg.App_Focus_True, BackToGame);
|
||||
SetSoundVolume();
|
||||
InitSystem();
|
||||
}
|
||||
|
||||
private void InitSystem()
|
||||
{
|
||||
gameDataSys = new GameDataSystem();
|
||||
windowSys = new WindowSystem();
|
||||
rewardSys = new RewardSystem();
|
||||
consumeSys = new ConsumeSystem();
|
||||
}
|
||||
|
||||
void BackToGame(object obj = null)
|
||||
{
|
||||
if (MaxPayManager.isPay)
|
||||
{
|
||||
MaxPayManager.isPay = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
MaxPayManager.Instance.PaySuccess();
|
||||
}
|
||||
|
||||
var last_time = PlayerPrefs.GetInt("Dayreftimes", 0);
|
||||
DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
newDate = newDate.AddSeconds(GameHelper.GetNowTime(true));
|
||||
// Debug.Log($"barry newdate==== {newDate}");
|
||||
var newDays = newDate.Day;
|
||||
|
||||
}
|
||||
private void OnGameStart(object obj)
|
||||
{
|
||||
var lang = PlayerPrefsKit.ReadString("LangIdKey");
|
||||
if (lang.IsNullOrWhiteSpace())
|
||||
{
|
||||
lang = "en";
|
||||
}
|
||||
Debug.Log(ConfigSystem.GetConfig<CommonModel>().ExchangeModeToggle + "//////////////////////");
|
||||
|
||||
//初始化商品
|
||||
// PurchasingManager.Instance.InitProduct();
|
||||
var appleData = new ApplePayData
|
||||
{
|
||||
sku = "",
|
||||
amount = 0,
|
||||
currency = "USD",
|
||||
shopName = "",
|
||||
type = ""
|
||||
};
|
||||
// ApplePayManager.Instance.InitProduct(ConfigSystem.GetConfig<ApplePayModel2>().DataList,
|
||||
// ConfigManager.GameConfig.packageName, PurchasingManager.ApplePaySuccessCallback(appleData));
|
||||
|
||||
Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<ApplePayModel>().DataList));
|
||||
UIManager.Instance.SetSwitchLanguage(lang);
|
||||
|
||||
EnterHall(true);
|
||||
isGameStart = true;
|
||||
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.EnterHall);
|
||||
// Debug.Log("?????????????????" + PurchasingManager.GetPaySku(PayType.pack_reward));
|
||||
// Debug.Log(JsonConvert.SerializeObject(ConfigSystem.GetConfig<ApplePayModel>().DataList));
|
||||
// bool enterGame = CommonHelper.GetBoolByChance(ConfigSystem.GetConfig<CommonModel>().roomrate / 100f);
|
||||
// if (GameHelper.IsGiftSwitch() && enterGame)
|
||||
// {
|
||||
// EnterGame(enterGame);
|
||||
// }
|
||||
|
||||
// DOVirtual.DelayedCall(1f, PurchasingManager.StartPay);
|
||||
|
||||
}
|
||||
private void SetSoundVolume()
|
||||
{
|
||||
float last_sound = PlayerPrefs.GetFloat("soundVolume", 1.0f);
|
||||
// Debug.Log($"barry last_sound=== " + last_sound);
|
||||
GRoot.inst.soundVolume = last_sound;
|
||||
|
||||
AudioManager.Instance.SetBGMSound();
|
||||
}
|
||||
|
||||
private void EnterHall(object obj = null)
|
||||
{
|
||||
// int index = obj != null ? (int)obj : 2;
|
||||
|
||||
enterHallTimes++;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PlayUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardAniUI_Close);
|
||||
AudioManager.Instance.StopBGM();
|
||||
AudioManager.Instance.PlayBGM(AudioConst.MainBg);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && (obj != null))
|
||||
{
|
||||
int h5rate = GameHelper.GetCommonModel().loginhallrate;
|
||||
int roomrate = GameHelper.GetCommonModel().roomrate;
|
||||
// if (UnityEngine.Random.Range(1, 100) < h5rate) {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
// } else
|
||||
if (UnityEngine.Random.Range(1, 100) < roomrate)
|
||||
{//进入玩法
|
||||
|
||||
GameHelper.is_first_login = false;
|
||||
// OnClickPlay();
|
||||
if (!SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
}
|
||||
if (!SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RainPlayUI_Open, true);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.is_first_login = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open, true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.is_first_login = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
}
|
||||
|
||||
|
||||
if (GameHelper.IsGiftSwitch()) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BroadcastUI_Open);
|
||||
GameHelper.PlayGameTimeEvent(1);
|
||||
}
|
||||
|
||||
|
||||
private void EnterGame(object obj)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MainUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RainPlayUI_Open);
|
||||
AudioManager.Instance.StopBGM();
|
||||
|
||||
AudioManager.Instance.PlayBGM(AudioConst.GameBg);
|
||||
|
||||
}
|
||||
|
||||
#region 缓存资源
|
||||
|
||||
public void GetGalleryNet(int imageID, Action<bool> action = null)
|
||||
{
|
||||
// StartCoroutine(TextureHelper.GetGalleryFromNet(imageID, action));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (!isGameStart) return;
|
||||
UpdateEvent?.Invoke();
|
||||
_secondTime += Time.deltaTime;
|
||||
_secondTime1 += Time.deltaTime;
|
||||
if (_secondTime >= 1)
|
||||
{
|
||||
_secondTime = 0;
|
||||
UpdateSecondEvent?.Invoke();
|
||||
}
|
||||
|
||||
if (_secondTime1 >= 5)
|
||||
{
|
||||
_secondTime1 = 0;
|
||||
UpdateFiveSecondEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddChangeGiftSwitch(Action action)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveChangeGiftSwitch(Action action)
|
||||
{
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
// DataMgr.ImmediateSendSave();
|
||||
}
|
||||
|
||||
private bool isInH5;
|
||||
|
||||
public void SetInH5(bool isInH5)
|
||||
{
|
||||
this.isInH5 = isInH5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b0f6f2d2a8a4351902376d77d27b4e8
|
||||
timeCreated: 1681804729
|
||||
@@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class NetworkManager : BaseUnityManager<NetworkManager>
|
||||
{
|
||||
#if GAME_RELEASE
|
||||
public static string crazyUrl => true ? DomainReleaseUrl : DomainDebugUrl;
|
||||
#else
|
||||
public static string crazyUrl => false ? DomainReleaseUrl : DomainDebugUrl;
|
||||
#endif
|
||||
public const string DomainRelease = "chillconnect.fun";
|
||||
//is debug test--------
|
||||
public const string DomainDebugUrl = @"https://api.jsoncompare.online/";
|
||||
public static readonly string DomainReleaseUrl = $"https://{DomainRelease}/api/";
|
||||
|
||||
public static bool isWatchedAD = false;
|
||||
|
||||
public const string identifier = "com.matchgame.captaindicedubloons";
|
||||
private LoginSystem loginSystem;
|
||||
private ConfigSystem configSystem;
|
||||
private PlayDataSystem playDataSystem;
|
||||
public static bool haveSimCard = false;
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
InitSystem();
|
||||
}
|
||||
|
||||
private void InitSystem()
|
||||
{
|
||||
loginSystem = new LoginSystem();
|
||||
configSystem = new ConfigSystem();
|
||||
playDataSystem = new PlayDataSystem();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54f9fcd655e04ba99afa430eec09c068
|
||||
timeCreated: 1681976638
|
||||
Reference in New Issue
Block a user