Пример #1
0
 protected override void OnDragDropStart()
 {
     //当拖拽开始时存储原始的父对象
     sourceParent = transform.parent.gameObject;
     prePos       = transform.localPosition;
     LuaToCSFunction.CallToLuaFunction("OnDragDropStart", ItemID);
     base.OnDragDropStart();
 }
Пример #2
0
        void Awake()
        {
            // Application.persistentDataPath Unity中只有这个路径是既可以读也可以写的。
            string persistentPath = "";

            if (LuaToCSFunction.GetApplicationPlatform() == 3)
            {
                persistentPath = Application.streamingAssetsPath;
            }
            else
            {
                persistentPath = Application.persistentDataPath;
            }
            string base_path = persistentPath + "/logs";

            if (!Directory.Exists(base_path))
            {
                Directory.CreateDirectory(base_path);
            }
            string log_path = base_path + "/outLog.txt";

            // 将上一个log转移logs目录
            if (File.Exists(log_path))
            {
                DateTime last_time   = File.GetLastWriteTime(log_path);
                string   time_str    = string.Format("{0:yyyy-MM-dd_HH-mm-ss}", last_time);
                string   backup_path = base_path + "/BOWLog_" + time_str + ".txt";
                File.Copy(log_path, backup_path);
                File.Delete(log_path);
            }
            // 每次启动客户端删除10天前保存的Log
            DateTime time      = DateTime.Now;
            DateTime pass_time = time.AddDays(-10);

            foreach (string full_name in Directory.GetFiles(base_path))
            {
                if (File.GetLastWriteTime(full_name) < pass_time)
                {
                    File.Delete(full_name);
                }
            }
            writer = new StreamWriter(log_path, false, Encoding.UTF8);
            // 在这里做一个Log的监听
            Application.RegisterLogCallback(HandleLog);

            //Application.logMessageReceived += HandleLog;
            // OutLog的第一个输出
            Debug.Log("OutLog Start");
        }
Пример #3
0
    // Use this for initialization
    public void Init()
    {
        if (LuaToCSFunction.IsIphoneX())
        {
            Camera cam = AppConst.UIRoot.Find("Camera").GetComponent <Camera>();
            LuaToCSFunction.SetUICameraRect(cam, 0, 0.04f, 1, 0.92f);
        }
        ui = ObjectPoolManager.Instance.LoadObjectByName("Prefabs/Common/LoadingView", AppConst.UIRoot);
        ui.transform.localPosition = Vector3.zero;
        ui.transform.localScale    = Vector3.one;

        m_Slider = ui.transform.Find("Slider").GetComponent <UISlider>();
        TweenProperty por = TweenProperty.BeginTween(m_Slider.gameObject, "UISlider", "value", 0.01, 1, 10);

        por.ignoreTimeScale = false;
    }
Пример #4
0
 private AudioSource m_bgMusic; //背景音乐
 private AudioManager()
 {
     Volumn      = LuaToCSFunction.GetMusic() ? 1 : 0;
     SoundVolumn = LuaToCSFunction.GetMusic() ? 1 : 0;
     m_soundsDic = new Dictionary <string, AudioClip>();
 }
Пример #5
0
 //该方法用于获取拖拽的物体释放拖拽时,该物体所碰撞的对象
 //所以我们前面需要给Cell和Obj都添加Box Collider
 protected override void OnDragDropRelease(GameObject surface)
 {
     base.OnDragDropRelease(surface);
     LuaToCSFunction.CallToLuaFunction("OnDragDropRelease", gameObject, surface, ItemID);
 }
Пример #6
0
 public void Destroy()
 {
     ObjectPoolManager.Instance.PoolDestroy(ui);
     LuaFramework.Util.ClearMemory();
     LuaToCSFunction.CallToLuaFunction("LoadingComplete");
 }
Пример #7
0
 void PayMoneyFailed(string result)
 {
     LuaToCSFunction.PayMoneyCallBack(result, 0);
 }
Пример #8
0
 //java或者ios回调函数
 void PayMoneySuccess(string receipt_data)
 {
     LuaToCSFunction.PayMoneyCallBack(receipt_data);
 }