add
This commit is contained in:
8
Assets/trCRM/Scripts/Main.meta
Normal file
8
Assets/trCRM/Scripts/Main.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7e8ebaff01ae4677874293e5c07cab0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/trCRM/Scripts/Main/MyMain.cs
Normal file
32
Assets/trCRM/Scripts/Main/MyMain.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Coolape;
|
||||
|
||||
public class MyMain : CLMainBase
|
||||
{
|
||||
[Tooltip("状态栏是否显示状态及通知")]
|
||||
public bool statusBar = false;
|
||||
[Tooltip("状态栏样式")]
|
||||
public AndroidStatusBar.States statesBar = AndroidStatusBar.States.Visible;
|
||||
public override void init()
|
||||
{
|
||||
string str = "qdkdkdkdkd";
|
||||
Debug.Log(System.Text.RegularExpressions.Regex.Split(str, "d*").Length);
|
||||
base.init();
|
||||
|
||||
if (Application.platform == RuntimePlatform.Android)
|
||||
{
|
||||
if (statusBar)
|
||||
{
|
||||
Screen.fullScreen = false;
|
||||
}
|
||||
//AndroidStatusBar.statusBarState = statesBar;
|
||||
//AndroidStatusBar.dimmed = !statusBar;
|
||||
}
|
||||
}
|
||||
|
||||
public override void doOffline()
|
||||
{
|
||||
base.doOffline();
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/Main/MyMain.cs.meta
Normal file
11
Assets/trCRM/Scripts/Main/MyMain.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d951d33d5b4047c68866e4fb9f99e2e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/trCRM/Scripts/NAudio.meta
Normal file
8
Assets/trCRM/Scripts/NAudio.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79314345aa5844e9998f22d91af26b7f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
125
Assets/trCRM/Scripts/NAudio/Mp3PlayerByUrl.cs
Normal file
125
Assets/trCRM/Scripts/NAudio/Mp3PlayerByUrl.cs
Normal file
@@ -0,0 +1,125 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using Coolape;
|
||||
|
||||
public class Mp3PlayerByUrl : MonoBehaviour
|
||||
{
|
||||
public AudioSource audioSource;
|
||||
public string mUrl;
|
||||
public AudioType audioType = AudioType.MPEG;
|
||||
public UnityWebRequest www;
|
||||
public AudioClip myClip;
|
||||
public object finishCallback;
|
||||
public object progressCallback;
|
||||
public bool isPlaying = false;
|
||||
|
||||
public UnityWebRequest getAudioClip(string url, object callback)
|
||||
{
|
||||
StartCoroutine(_getAudioClip(url, callback));
|
||||
return www;
|
||||
}
|
||||
|
||||
public IEnumerator _getAudioClip(string url, object callback)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url))
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
www = UnityWebRequestMultimedia.GetAudioClip(url, audioType);
|
||||
using (www)
|
||||
{
|
||||
yield return www.SendWebRequest();
|
||||
|
||||
if (www.isNetworkError)
|
||||
{
|
||||
Debug.Log(www.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
myClip = DownloadHandlerAudioClip.GetContent(www);
|
||||
Utl.doCallback(callback, myClip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void play(AudioClip clip, object progressCb, object finishCb)
|
||||
{
|
||||
if (clip == null) return;
|
||||
progressCallback = progressCb;
|
||||
finishCallback = finishCb;
|
||||
audioSource.clip = myClip;
|
||||
audioSource.time = 0;
|
||||
audioSource.Play();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (audioSource == null || audioSource.clip == null) return;
|
||||
if (!audioSource.isPlaying && isPlaying && Mathf.Abs(1 - audioSource.time / audioSource.clip.length) <= 0.01)
|
||||
{
|
||||
isPlaying = audioSource.isPlaying;
|
||||
Utl.doCallback(finishCallback, audioSource.clip);
|
||||
//stop();
|
||||
audioSource.time = 0;
|
||||
}
|
||||
else if(audioSource.isPlaying)
|
||||
{
|
||||
isPlaying = audioSource.isPlaying;
|
||||
Utl.doCallback(progressCallback, audioSource.time / audioSource.clip.length, audioSource.time);
|
||||
}
|
||||
}
|
||||
|
||||
public float progress()
|
||||
{
|
||||
if (audioSource == null || audioSource.clip == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return audioSource.time / audioSource.clip.length;
|
||||
}
|
||||
|
||||
public void stop()
|
||||
{
|
||||
audioSource.Stop();
|
||||
}
|
||||
|
||||
public void release()
|
||||
{
|
||||
stop();
|
||||
if (audioSource.clip != null)
|
||||
{
|
||||
Destroy(audioSource.clip);
|
||||
audioSource.clip = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void pause()
|
||||
{
|
||||
audioSource.Pause();
|
||||
}
|
||||
|
||||
public void rePlay()
|
||||
{
|
||||
audioSource.UnPause();
|
||||
if (!audioSource.isPlaying)
|
||||
{
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public void seek(float persent)
|
||||
{
|
||||
if (audioSource != null)
|
||||
{
|
||||
float sec = audioSource.clip.length * persent;
|
||||
audioSource.time = sec;
|
||||
if (!audioSource.isPlaying)
|
||||
{
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/trCRM/Scripts/NAudio/Mp3PlayerByUrl.cs.meta
Normal file
11
Assets/trCRM/Scripts/NAudio/Mp3PlayerByUrl.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 468c5112a721645e78cea88b0e3d1ce7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/trCRM/Scripts/public.meta
Normal file
8
Assets/trCRM/Scripts/public.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 220261da2d9c74669b6ec1b59f2b16b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/trCRM/Scripts/public/MyCfg.cs
Normal file
10
Assets/trCRM/Scripts/public/MyCfg.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Coolape;
|
||||
|
||||
public class MyCfg : CLCfgBase
|
||||
{
|
||||
public static int mode = 0;
|
||||
public string default_UID = "";
|
||||
//TODO:
|
||||
}
|
||||
11
Assets/trCRM/Scripts/public/MyCfg.cs.meta
Normal file
11
Assets/trCRM/Scripts/public/MyCfg.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e28cad2f718f443db7bef1ef8b01221
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/trCRM/Scripts/public/MyWWWTexture.cs
Normal file
51
Assets/trCRM/Scripts/public/MyWWWTexture.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Coolape;
|
||||
|
||||
public class MyWWWTexture : MonoBehaviour
|
||||
{
|
||||
string mUrl;
|
||||
public UITexture texture;
|
||||
public bool pixelPerfect = true;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
loadTextrue();
|
||||
}
|
||||
|
||||
public string url
|
||||
{
|
||||
get
|
||||
{
|
||||
return mUrl;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if(value != null && !value.Equals(mUrl))
|
||||
{
|
||||
mUrl = value;
|
||||
loadTextrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadTextrue()
|
||||
{
|
||||
if (string.IsNullOrEmpty(url)) return;
|
||||
WWWEx.get(url, CLAssetType.texture, (Callback)onLoadTexture, null, url, true, 2);
|
||||
}
|
||||
|
||||
void onLoadTexture(params object[] objs)
|
||||
{
|
||||
Texture tex = objs[0] as Texture;
|
||||
string _url = objs[1] as string;
|
||||
if(_url.Equals(url))
|
||||
{
|
||||
texture.mainTexture = tex;
|
||||
if (pixelPerfect) texture.MakePixelPerfect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/trCRM/Scripts/public/MyWWWTexture.cs.meta
Normal file
11
Assets/trCRM/Scripts/public/MyWWWTexture.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6acd50f2b7d0b4de3902d54ce2eb83f4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/trCRM/Scripts/stomp.meta
Normal file
8
Assets/trCRM/Scripts/stomp.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24ad222aaf90e4e88a89e4fd237253be
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/trCRM/Scripts/ui.meta
Normal file
8
Assets/trCRM/Scripts/ui.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3563c9e91ebd246d1a21913a43bdb31f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
72
Assets/trCRM/Scripts/ui/CLUICheckbox.cs
Normal file
72
Assets/trCRM/Scripts/ui/CLUICheckbox.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Coolape;
|
||||
|
||||
public class CLUICheckbox : CLUIElement
|
||||
{
|
||||
public bool isMultMode = true;
|
||||
object data;
|
||||
//ArrayList checkeds = new ArrayList();
|
||||
string _value = "";
|
||||
|
||||
public List<EventDelegate> onChange = new List<EventDelegate>();
|
||||
|
||||
public void init(object data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
protected void ExecuteOnChange()
|
||||
{
|
||||
if (EventDelegate.IsValid(onChange))
|
||||
{
|
||||
EventDelegate.Execute(onChange, gameObject); // modify by chenbin
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClick()
|
||||
{
|
||||
CLPanelManager.getPanelAsy("PanelPopCheckBoxs", (Callback)onGetPanel);
|
||||
}
|
||||
void onGetPanel(params object[] obj)
|
||||
{
|
||||
CLPanelLua p = (CLPanelLua)(obj[0]);
|
||||
ArrayList orgs = new ArrayList();
|
||||
orgs.Add(data);
|
||||
orgs.Add(value);
|
||||
orgs.Add(isMultMode);
|
||||
orgs.Add((Callback)onSelectedValue);
|
||||
p.setData(orgs);
|
||||
CLPanelManager.showTopPanel(p, true, true);
|
||||
}
|
||||
|
||||
void onSelectedValue(params object[] orgs)
|
||||
{
|
||||
string val = orgs[0].ToString();
|
||||
value = val;
|
||||
}
|
||||
|
||||
public override object value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
set
|
||||
{
|
||||
_value = value.ToString();
|
||||
ExecuteOnChange();
|
||||
}
|
||||
}
|
||||
|
||||
public override object getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public override void setValue(object obj)
|
||||
{
|
||||
value = obj;
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/CLUICheckbox.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/CLUICheckbox.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10e537da23dab4a78b272e1caed2ad0f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
33
Assets/trCRM/Scripts/ui/MyDragEvent4Page.cs
Normal file
33
Assets/trCRM/Scripts/ui/MyDragEvent4Page.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Coolape;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class MyDragEvent4Page : UIEventListener
|
||||
{
|
||||
public MyDragManager _dragPage;
|
||||
|
||||
public MyDragManager dragPage {
|
||||
get {
|
||||
if (_dragPage == null) {
|
||||
_dragPage = GetComponentInParent<MyDragManager> ();
|
||||
}
|
||||
return _dragPage;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPress (bool isPressed)
|
||||
{
|
||||
if (dragPage != null) {
|
||||
dragPage.OnPress (isPressed);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDrag (Vector2 delta)
|
||||
{
|
||||
if (dragPage != null) {
|
||||
dragPage.OnDrag (delta);
|
||||
dragPage.notifyDrag (delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyDragEvent4Page.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyDragEvent4Page.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c959b935cdd44607b9e8c846bbedee7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
110
Assets/trCRM/Scripts/ui/MyDragManager.cs
Normal file
110
Assets/trCRM/Scripts/ui/MyDragManager.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using Coolape;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class MyDragManager : UIEventListener
|
||||
{
|
||||
public UIDragPageContents _dragPage;
|
||||
|
||||
public UIDragPageContents dragPage {
|
||||
get {
|
||||
if (_dragPage == null) {
|
||||
UIGridPage gridpage = GetComponentInParent<UIGridPage> ();
|
||||
if (gridpage != null) {
|
||||
_dragPage = gridpage.GetComponentInParent<UIDragPageContents> ();
|
||||
}
|
||||
}
|
||||
return _dragPage;
|
||||
}
|
||||
}
|
||||
|
||||
public UIDragScrollView _dragContent;
|
||||
|
||||
public UIDragScrollView dragContent {
|
||||
get {
|
||||
if (_dragContent == null) {
|
||||
_dragContent = GetComponentInParent<UIDragScrollView> ();
|
||||
}
|
||||
return _dragContent;
|
||||
}
|
||||
}
|
||||
|
||||
// Vector2 totalDelta = Vector2.zero;
|
||||
|
||||
public void Start ()
|
||||
{
|
||||
if (dragPage != null)
|
||||
dragPage.enabled = true;
|
||||
if (dragContent != null)
|
||||
dragContent.enabled = true;
|
||||
}
|
||||
|
||||
bool canDrag = false;
|
||||
|
||||
public void OnPress (bool isPressed)
|
||||
{
|
||||
if (!NGUITools.GetActive (this))
|
||||
return;
|
||||
if (isPressed) {
|
||||
canDrag = true;
|
||||
if (dragPage != null) {
|
||||
dragPage.enabled = true;
|
||||
dragPage.OnPress (isPressed);
|
||||
}
|
||||
if (dragContent != null) {
|
||||
dragContent.enabled = true;
|
||||
dragContent.OnPress (isPressed);
|
||||
}
|
||||
} else {
|
||||
canDrag = false;
|
||||
|
||||
if (dragPage != null) {
|
||||
dragPage.enabled = true;
|
||||
dragPage.OnPress (isPressed);
|
||||
}
|
||||
if (dragContent != null) {
|
||||
dragContent.enabled = true;
|
||||
dragContent.OnPress (isPressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyDrag (Vector2 delta)
|
||||
{
|
||||
if (!NGUITools.GetActive (this))
|
||||
return;
|
||||
if (dragPage != null && dragPage.enabled) {
|
||||
dragPage.OnDrag (delta);
|
||||
}
|
||||
if (dragContent != null && dragContent.enabled) {
|
||||
dragContent.OnDrag (delta);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDrag (Vector2 delta)
|
||||
{
|
||||
if (!NGUITools.GetActive (this))
|
||||
return;
|
||||
if (!canDrag) {
|
||||
return;
|
||||
}
|
||||
canDrag = false;
|
||||
if (Mathf.Abs (delta.x) > Mathf.Abs (delta.y)) {
|
||||
// dragPage.enabled = true;
|
||||
if (dragPage != null) {
|
||||
dragPage.enabled = true;
|
||||
dragContent.enabled = false;
|
||||
// dragPage.OnPress (true);
|
||||
// dragPage.OnDrag (delta);
|
||||
}
|
||||
} else {
|
||||
if (dragContent != null) {
|
||||
dragContent.enabled = true;
|
||||
dragPage.enabled = false;
|
||||
// dragContent.OnPress (true);
|
||||
// dragContent.OnDrag (delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyDragManager.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyDragManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea1ee2de65dd74683b569d4604546609
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
73
Assets/trCRM/Scripts/ui/MyInputReset.cs
Normal file
73
Assets/trCRM/Scripts/ui/MyInputReset.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MyInputReset : UIEventListener
|
||||
{
|
||||
public UIInput input;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
input = GetComponentInParent<UIInput>();
|
||||
}
|
||||
if (input != null)
|
||||
{
|
||||
EventDelegate newDel = new EventDelegate();
|
||||
newDel.target = this;
|
||||
newDel.methodName = "onInputChg";
|
||||
input.onChange.Add(newDel);
|
||||
onInputChg(input.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
bool _disabled = false;
|
||||
public bool disabled
|
||||
{
|
||||
set
|
||||
{
|
||||
_disabled = value;
|
||||
if (value)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (input != null)
|
||||
{
|
||||
onInputChg(input.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
get
|
||||
{
|
||||
return _disabled;
|
||||
}
|
||||
}
|
||||
|
||||
public void onInputChg(GameObject go)
|
||||
{
|
||||
if (disabled) return;
|
||||
if (string.IsNullOrEmpty(input.value))
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnClick()
|
||||
{
|
||||
if (disabled) return;
|
||||
if (input != null)
|
||||
{
|
||||
input.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyInputReset.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyInputReset.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce7ce3a27703447e98bd5b91307e34c8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
44
Assets/trCRM/Scripts/ui/MyUIElementRedstar.cs
Normal file
44
Assets/trCRM/Scripts/ui/MyUIElementRedstar.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MyUIElementRedstar : MonoBehaviour
|
||||
{
|
||||
public CLUIElement _element;
|
||||
CLUIElement element
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_element == null)
|
||||
{
|
||||
_element = GetComponent<CLUIElement>();
|
||||
if (_element == null)
|
||||
{
|
||||
_element = GetComponentInParent<CLUIElement>();
|
||||
|
||||
}
|
||||
}
|
||||
return _element;
|
||||
}
|
||||
}
|
||||
UILabel _label;
|
||||
UILabel label
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_label == null)
|
||||
{
|
||||
_label = GetComponent<UILabel>();
|
||||
}
|
||||
return _label;
|
||||
}
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (label != null && element != null)
|
||||
{
|
||||
label.enabled = !element.canNull;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyUIElementRedstar.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyUIElementRedstar.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd5e9ed3dcd9e4e4c81c8ceeeabc37bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
11
Assets/trCRM/Scripts/ui/MyUIPanel.cs
Normal file
11
Assets/trCRM/Scripts/ui/MyUIPanel.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Coolape;
|
||||
using XLua;
|
||||
|
||||
public class MyUIPanel : CLPanelLua
|
||||
{
|
||||
[HideInInspector]
|
||||
public string titleKeyName = "";
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyUIPanel.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyUIPanel.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ff491def90b44724978eb9e0b2b558f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
48
Assets/trCRM/Scripts/ui/MyUIWidgetAdjustWidth.cs
Normal file
48
Assets/trCRM/Scripts/ui/MyUIWidgetAdjustWidth.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class MyUIWidgetAdjustWidth : MonoBehaviour
|
||||
{
|
||||
public UIWidget widget;
|
||||
public int offset = 0;
|
||||
|
||||
public float sizeAdjust = 1;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
if (widget == null)
|
||||
{
|
||||
widget = GetComponent<UIWidget>();
|
||||
}
|
||||
UIRoot root = UIRoot.list[0];
|
||||
sizeAdjust = (root != null) ? root.pixelSizeAdjustment : 1f;
|
||||
sizeAdjust = sizeAdjust < 0.001f ? 1 : sizeAdjust;
|
||||
OnEnable();
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void Update()
|
||||
{
|
||||
OnEnable();
|
||||
}
|
||||
#endif
|
||||
void OnEnable()
|
||||
{
|
||||
if (widget)
|
||||
{
|
||||
widget.width = (int)(Screen.width * sizeAdjust - offset * 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/MyUIWidgetAdjustWidth.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/MyUIWidgetAdjustWidth.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0dbe6448146c445e5ae7040ea035c0fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/trCRM/Scripts/xLua.meta
Normal file
8
Assets/trCRM/Scripts/xLua.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87162ec3f77fd492b9b5ca2dbb929917
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
360
Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs
Normal file
360
Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs
Normal file
@@ -0,0 +1,360 @@
|
||||
//配置的详细介绍请看Doc下《XLua的配置.doc》
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using XLua;
|
||||
using Coolape;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
public static class XluaGenCodeConfig
|
||||
{
|
||||
//lua中要使用到C#库的配置,比如C#标准库,或者Unity API,第三方库等。
|
||||
[LuaCallCSharp]
|
||||
public static System.Collections.Generic.List<Type> LuaCallCSharp = new System.Collections.Generic.List<Type>() {
|
||||
typeof(System.Object),
|
||||
typeof(UnityEngine.Object),
|
||||
typeof(Vector2),
|
||||
typeof(Vector3),
|
||||
typeof(Vector4),
|
||||
typeof(Rect),
|
||||
typeof(Quaternion),
|
||||
typeof(Color),
|
||||
typeof(Ray),
|
||||
typeof(Ray2D),
|
||||
typeof(Bounds),
|
||||
typeof(Time),
|
||||
typeof(GameObject),
|
||||
typeof(Component),
|
||||
typeof(Behaviour),
|
||||
typeof(Transform),
|
||||
typeof(Resources),
|
||||
typeof(TextAsset),
|
||||
typeof(Keyframe),
|
||||
typeof(AnimationCurve),
|
||||
typeof(AnimationClip),
|
||||
typeof(MonoBehaviour),
|
||||
typeof(ParticleSystem),
|
||||
typeof(SkinnedMeshRenderer),
|
||||
typeof(Renderer),
|
||||
//typeof(WWW),
|
||||
typeof(System.Collections.Generic.List<int>),
|
||||
typeof(Action<string>),
|
||||
typeof(UnityEngine.Debug),
|
||||
typeof(Hashtable),
|
||||
typeof(ArrayList),
|
||||
typeof(Queue),
|
||||
typeof(Stack),
|
||||
typeof(GC),
|
||||
typeof(File),
|
||||
typeof(Directory),
|
||||
typeof(Application),
|
||||
typeof(SystemInfo),
|
||||
typeof(RaycastHit),
|
||||
typeof(System.IO.Path),
|
||||
typeof(System.IO.MemoryStream),
|
||||
typeof(Screen),
|
||||
typeof(PlayerPrefs),
|
||||
typeof(Shader),
|
||||
|
||||
//NGUI
|
||||
typeof(UIRoot),
|
||||
typeof(UICamera),
|
||||
typeof(Localization),
|
||||
typeof(NGUITools),
|
||||
typeof(UIRect),
|
||||
typeof(UIWidget),
|
||||
typeof(UIWidgetContainer),
|
||||
typeof(UILabel),
|
||||
typeof(UIToggle),
|
||||
typeof(UIBasicSprite),
|
||||
typeof(UITexture),
|
||||
typeof(UISprite),
|
||||
typeof(UIProgressBar),
|
||||
typeof(UISlider),
|
||||
typeof(UIGrid),
|
||||
typeof(UITable),
|
||||
typeof(UIInput),
|
||||
typeof(UIScrollView),
|
||||
typeof(UITweener),
|
||||
typeof(TweenWidth),
|
||||
typeof(TweenRotation),
|
||||
typeof(TweenPosition),
|
||||
typeof(TweenScale),
|
||||
typeof(TweenAlpha),
|
||||
typeof(UICenterOnChild),
|
||||
typeof(UIAtlas),
|
||||
typeof(UILocalize),
|
||||
typeof(UIPlayTween),
|
||||
typeof(UIRect.AnchorPoint),
|
||||
typeof(UIButton),
|
||||
typeof(UIPopupList),
|
||||
|
||||
//Coolape
|
||||
typeof(CLAssetsManager),
|
||||
typeof(CLAssetsPoolBase<UnityEngine.Object>),
|
||||
typeof(B2InputStream),
|
||||
typeof(B2OutputStream),
|
||||
typeof(CLBulletBase),
|
||||
typeof(CLBulletPool),
|
||||
typeof(CLEffect),
|
||||
typeof(CLEffectPool),
|
||||
typeof(CLMaterialPool),
|
||||
typeof(CLRolePool),
|
||||
typeof(CLSoundPool),
|
||||
typeof(CLSharedAssets),
|
||||
typeof(CLSharedAssets.CLMaterialInfor),
|
||||
typeof(CLTexturePool),
|
||||
typeof(CLThingsPool),
|
||||
typeof(CLBaseLua),
|
||||
typeof(CLBehaviour4Lua),
|
||||
typeof(CLUtlLua),
|
||||
typeof(CLMainBase),
|
||||
typeof(Net),
|
||||
typeof(Net.NetWorkType),
|
||||
typeof(CLCfgBase),
|
||||
typeof(CLPathCfg),
|
||||
typeof(CLVerManager),
|
||||
typeof(CLAssetType),
|
||||
typeof(CLRoleAction),
|
||||
typeof(CLRoleAvata),
|
||||
typeof(CLUnit),
|
||||
|
||||
typeof(ColorEx),
|
||||
typeof(BlockWordsTrie),
|
||||
typeof(DateEx),
|
||||
typeof(FileEx),
|
||||
typeof(HttpEx),
|
||||
typeof(JSON),
|
||||
typeof(ListEx),
|
||||
typeof(MapEx),
|
||||
typeof(MyMainCamera),
|
||||
typeof(MyTween),
|
||||
typeof(NewList),
|
||||
typeof(NewMap),
|
||||
typeof(SoundEx),
|
||||
typeof(NumEx),
|
||||
typeof(ObjPool),
|
||||
typeof(PStr),
|
||||
typeof(SScreenShakes),
|
||||
typeof(StrEx),
|
||||
typeof(Utl),
|
||||
typeof(WWWEx),
|
||||
typeof(ZipEx),
|
||||
typeof(XXTEA),
|
||||
|
||||
typeof(CLButtonMsgLua),
|
||||
typeof(CLJoystick),
|
||||
typeof(CLUIDrag4World),
|
||||
typeof(CLUILoopGrid),
|
||||
typeof(CLUILoopTable),
|
||||
// typeof(CLUILoopGrid2),
|
||||
typeof(CLUIPlaySound),
|
||||
typeof(TweenSpriteFill),
|
||||
typeof(UIDragPage4Lua),
|
||||
typeof(UIDragPageContents),
|
||||
typeof(UIGridPage),
|
||||
typeof(UIMoveToCell),
|
||||
typeof(UISlicedSprite),
|
||||
|
||||
typeof(CLAlert),
|
||||
typeof(CLCellBase),
|
||||
typeof(CLCellLua),
|
||||
typeof(CLPanelBase),
|
||||
typeof(CLPanelLua),
|
||||
typeof(CLPanelManager),
|
||||
typeof(CLPanelMask4Panel),
|
||||
typeof(CLPBackplate),
|
||||
typeof(CLUIInit),
|
||||
typeof(CLUIOtherObjPool),
|
||||
typeof(CLUIRenderQueue),
|
||||
typeof(CLUIUtl),
|
||||
typeof(EffectNum),
|
||||
typeof(TweenProgress),
|
||||
typeof(B2Int),
|
||||
typeof(AngleEx),
|
||||
typeof(CLGridPoints),
|
||||
typeof(CLUIFormRoot),
|
||||
typeof(CLUIFormUtl),
|
||||
typeof(CLUIElement),
|
||||
typeof(CLUIElementDate),
|
||||
typeof(CLUIElementPopList),
|
||||
//==========================
|
||||
typeof(MyMain),
|
||||
typeof(MyCfg),
|
||||
typeof(NativeGallery),
|
||||
typeof(NativeGalleryUtl),
|
||||
typeof(LBSUtl),
|
||||
typeof(MyWWWTexture),
|
||||
typeof(MyLocation),
|
||||
typeof(MyLocation.CoorType),
|
||||
typeof(AndroidStatusBar),
|
||||
typeof(Uri),
|
||||
typeof(Time),
|
||||
typeof(Dist.SpringWebsocket.Client),
|
||||
typeof(Dist.SpringWebsocket.StompFrame),
|
||||
typeof(Dist.SpringWebsocket.StatusCodeEnum),
|
||||
typeof(Mp3PlayerByUrl),
|
||||
typeof(CLUICheckbox),
|
||||
typeof(CLUIPopListPanel),
|
||||
};
|
||||
|
||||
//C#静态调用Lua的配置(包括事件的原型),仅可以配delegate,interface
|
||||
[CSharpCallLua]
|
||||
public static System.Collections.Generic.List<Type> CSharpCallLua = new System.Collections.Generic.List<Type>() {
|
||||
typeof(Action),
|
||||
typeof(Func<double, double, double>),
|
||||
typeof(Action<string>),
|
||||
typeof(Action<double>),
|
||||
typeof(UnityEngine.Events.UnityAction),
|
||||
typeof(Coolape.Callback),
|
||||
};
|
||||
|
||||
//黑名单
|
||||
[BlackList]
|
||||
public static List<List<string>> BlackList = new List<List<string>>() {
|
||||
new List<string>(){ "UnityEngine.WWW", "movie" },
|
||||
new List<string>(){ "UnityEngine.Texture2D", "alphaIsTransparency" },
|
||||
new List<string>(){ "UnityEngine.Security", "GetChainOfTrustValue" },
|
||||
new List<string>(){ "UnityEngine.CanvasRenderer", "onRequestRebuild" },
|
||||
new List<string>(){ "UnityEngine.Light", "areaSize" },
|
||||
new List<string>(){ "UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup" },
|
||||
#if !UNITY_WEBPLAYER
|
||||
new List<string>(){ "UnityEngine.Application", "ExternalEval" },
|
||||
#endif
|
||||
new List<string>(){ "UnityEngine.GameObject", "networkView" }, //4.6.2 not support
|
||||
new List<string>(){ "UnityEngine.Component", "networkView" }, //4.6.2 not support
|
||||
new List<string>() {
|
||||
"System.IO.FileInfo",
|
||||
"GetAccessControl",
|
||||
"System.Security.AccessControl.AccessControlSections"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.FileInfo",
|
||||
"SetAccessControl",
|
||||
"System.Security.AccessControl.FileSecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.DirectoryInfo",
|
||||
"GetAccessControl",
|
||||
"System.Security.AccessControl.AccessControlSections"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.DirectoryInfo",
|
||||
"SetAccessControl",
|
||||
"System.Security.AccessControl.DirectorySecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.DirectoryInfo",
|
||||
"CreateSubdirectory",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.DirectorySecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.DirectoryInfo",
|
||||
"Create",
|
||||
"System.Security.AccessControl.DirectorySecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.Directory",
|
||||
"CreateDirectory",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.DirectorySecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.Directory",
|
||||
"SetAccessControl",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.DirectorySecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.Directory",
|
||||
"GetAccessControl",
|
||||
"System.String"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.Directory",
|
||||
"GetAccessControl",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.AccessControlSections"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.File",
|
||||
"Create",
|
||||
"System.String",
|
||||
"System.Int32",
|
||||
"System.IO.FileOptions"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.File",
|
||||
"Create",
|
||||
"System.String",
|
||||
"System.Int32",
|
||||
"System.IO.FileOptions",
|
||||
"System.Security.AccessControl.FileSecurity"
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.File",
|
||||
"GetAccessControl",
|
||||
"System.String",
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.File",
|
||||
"GetAccessControl",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.AccessControlSections",
|
||||
},
|
||||
new List<string>() {
|
||||
"System.IO.File",
|
||||
"SetAccessControl",
|
||||
"System.String",
|
||||
"System.Security.AccessControl.FileSecurity",
|
||||
},
|
||||
new List<string>() {
|
||||
"Coolape.CLUnit",
|
||||
"OnDrawGizmos",
|
||||
},
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
new List<string>() {
|
||||
"UIInput",
|
||||
"ProcessEvent",
|
||||
"UnityEngine.Event",
|
||||
},
|
||||
#endif
|
||||
new List<string>() {
|
||||
"UIWidget",
|
||||
"showHandlesWithMoveTool",
|
||||
},
|
||||
new List<string>() {
|
||||
"UIWidget",
|
||||
"showHandles",
|
||||
},
|
||||
|
||||
new List<string>() {
|
||||
"Coolape.PStr",
|
||||
"a",
|
||||
"System.Byte",
|
||||
},
|
||||
|
||||
new List<string>() {
|
||||
"Coolape.PStr",
|
||||
"a",
|
||||
"System.Byte[]",
|
||||
},
|
||||
|
||||
new List<string>() {
|
||||
"UnityEngine.MonoBehaviour",
|
||||
"runInEditMode",
|
||||
},
|
||||
|
||||
new List<string>() {
|
||||
"Coolape.CLAssetsManager",
|
||||
"debugKey",
|
||||
},
|
||||
new List<string>() {
|
||||
"MyCfg",
|
||||
"default_UID",
|
||||
},
|
||||
};
|
||||
}
|
||||
11
Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs.meta
Normal file
11
Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bef664080cb6346ffb54ad3b1c4b5738
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user