Example #1
0
 public void string_callback(CallBack cb, [StringValue][WideChar(false)] string mesg) {
     if(cb == null) {
         Console.WriteLine("Received a nil callback.");
         return;
     }              
     cb.call_back(mesg);
 }
Example #2
0
        public static void Main()
        {
            CallBack callback = new CallBack(TimeNow);
            Timer time = new Timer(callback.Invoke, null, 0, 1000);

            Console.Read(); //press enter to exit
        }
Example #3
0
    void Start()
    {
        dead = Skip;

        m_currentTurn = -1;
        Subscribe("skip", "me", dead);
    }
    public static void Request(MethodType method, string uri, string body, CallBack<string> callBack)
    {
        try
        {
            Init("8aa5b8b5-f769-11e3-954e-06a6fa0000b9", "6ef2e5c0-3ef1-11e4-ae91-06a6fa0000b9");

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(APIEndpoint + uri);

            request.Method = method.ToString();
            request.ContentType = "applications/json";

            if (PlayerPrefs.HasKey("access_token"))
            request.Headers["Authorization"] = "Bearer " + PlayerPrefs.GetString("access_token");

            if(request.Method == "POST" || request.Method == "PUT")
            {
                StreamWriter writer = new StreamWriter(request.GetRequestStream());
                writer.Write(body);
                writer.Close();
            }

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);

            string responseFromServer = reader.ReadToEnd();

            callBack(responseFromServer);
        }
        catch(Exception e)
        {
            Debug.Log(e.Message);
        }
    }
 //从淡入到淡出
 public void FadeInToOut(float _fadeInTime, float afterInDelayTime, float _fadeOutTime, CallBack afterFadeInCallback=null, CallBack afterFadeOutCallback = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeInToOutAction(_fadeInTime, afterInDelayTime, _fadeOutTime, afterFadeInCallback, afterFadeOutCallback));
     }
 }
 //淡入
 public void FadeIn(float _fadeInTime, CallBack _fun = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeAction(true,_fadeInTime, _fun));
     }
 }
Example #7
0
 public void addEventListner(string eventType,CallBack function)
 {
     if(_listenList==null){
         _listenList		= new List<EventListenTerm>();
     }
     _listenList.Add(new EventListenTerm(eventType,function));
 }
 //淡出
 public void FadeOut(float _fadeOutTime, CallBack _fun = null)
 {
     if (!isFading)
     {
         StartCoroutine(FadeAction(false,_fadeOutTime, _fun));
     }
 }
        public void Handle(List<UPnPArg> args, CallBack cb, XMLWriterPi writer)
        {
            Console.WriteLine("Browse Was called (BrowseStrat)");
            List<UPnPArg> retArgs = new List<UPnPArg>();

            string containerId = GetContainerID(args);

            if (containerId == "BadArgs")
            {
                cb(retArgs, containerId);
            }
            else
            {
                List<ITrack> containingList = _dbLookup.Browse(containerId);
                int NumberReturned = containingList.Count;

                string retVal = writer.ConvertITrackToXML(containingList);

                retArgs.Add(new UPnPArg("Result", retVal));
                retArgs.Add(new UPnPArg("NumberReturned", NumberReturned.ToString()));
                retArgs.Add(new UPnPArg("TotalMatches", NumberReturned.ToString()));

                cb(retArgs, "Browse");
            }
        }
 public void registerCallBack(CallBack callbackToRegister)
 {
     if(!m_Listeners.Contains(callbackToRegister))
     {
         m_Listeners.Add(callbackToRegister);
     }
 }
 public void removeCallBack(CallBack callbackToRemove)
 {
     if (m_Listeners.Contains(callbackToRemove))
     {
         m_Listeners.Remove(callbackToRemove);
     }
 }
 //passing the delegate as a parameter
 // declaring the delegate
 public void LongForLoop(CallBack obj)
 {
     for (int i = 0; i < 10000; i++)
     {
         obj(i); //invokeing the delegate
     }
 }
Example #13
0
        public void AddVkFriend(string uid, CallBack onSuccess, CallBack onError)
        {
            if (!this.connected)
            {
                return;
            }

            var url = "https://api.vk.com/method/friends.add";
            var sendData = new Dictionary<string, string>
                               {
                                   { "access_token", this.access_token },
                                   { "uid", uid }
                               };
            this.GetQuery(
                url,
                sendData,
                res =>
                    {
                        var decodedResponse = Newtonsoft.Json.Linq.JObject.Parse(res.ToString());
                        var answer = decodedResponse["response"];
                        if (answer == null)
                        {
                            onError(new object());
                            return;
                        }

                        onSuccess(answer.ToString());
                    },
                res =>
                    {
                        onError(new object());
                    });
        }
Example #14
0
    IEnumerator FadeAction(bool isFadeIn,float tempFadeTime,  CallBack _fun)
    {
        tempColor = GUI.color;
        GUI.depth = 100;
        fadeTime = tempFadeTime;

        if (isFadeIn) alpha = 0;
        else alpha = 1;

        if (crossfadeTexture == null)
        {
            crossfadeTexture = new Texture2D(1, 1, TextureFormat.RGB24, false);
            crossfadeTexture.SetPixel(0, 0, Color.black);
            crossfadeTexture.Apply();
        }

        isFading = true;
        float tempTime = fadeTime + Time.unscaledTime; ;

        while (true)
        {
                if (!isFadeIn)
                {
                    alpha = (tempTime - Time.unscaledTime) / fadeTime;

                    if (alpha < 0.05f)
                    {
                        alpha = 0;
                        break;
                    }
                }
                else
                {
                    alpha = Mathf.Clamp(1 - ((tempTime - Time.unscaledTime) / fadeTime), 0f, 1f);

                    if (alpha >= 0.98f)
                    {
                        alpha = 1;
                        break;
                    }
                }
            yield return new WaitForEndOfFrame();
        }
        yield return new WaitForEndOfFrame();
        isFading = false;
        Debug.Log("Camera fade alpha: " + alpha);
        try
        {
            if (_fun != null)
            {
                _fun();
            }
        }
        catch (Exception e)
        {
            Debug.LogError("Camera Fade Call back Exception :" + e);
        }
          //  yield return new WaitForEndOfFrame();
    }
Example #15
0
        public static void Main(string[] args)
        {
            // Create an instance of the delegate
            CallBack myCallBack = new CallBack(Program.Report);

            // Call the function
            EnumWindows(myCallBack, 0);
        }
Example #16
0
 public void RequestInventory(string accountID, CallBack callBack)
 {
     string url = host + "getInventory";
     WWWForm form = new WWWForm();
     form.AddField("PlayerId", accountID.ToString());
     WWW www = new WWW(url, form);
     StartCoroutine(WaitForRequest(www, callBack));
 }
Example #17
0
 public void onShowDCN(string mess, CallBack clickOK) {
     DoOnMainThread.ExecuteOnMainThread.Enqueue(() => {
         this.lb_mess.text = mess;
         btnOK.gameObject.SetActive(true);
         onClickOK = clickOK;
         onShow();
     });
 }
Example #18
0
		public void CollectWindowDetails()
		{
            System.Diagnostics.Process Proc = System.Diagnostics.Process.GetCurrentProcess();
            m_hWndMain = (int)Proc.MainWindowHandle;
            ClearWindowDetails();
            CallBack myCallBack = new CallBack(WindowEnumerator.WindowInformation);
            bool x = false;
            NativeMethods.EnumWindows(myCallBack, ref x);
		}
 //a string is given to the constructor which creates a font object
 public CKLBUIDebugItem(CKLBUITask parent, uint order, float x, float y, uint argb, String font_name, uint font_size, String text, uint cmdID, CallBack callback)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUIDebugItem_create(parent != null ? parent.CppObject : IntPtr.Zero, order, x, y, argb, __MarshallingUtils.NativeUtf8FromString(font_name), font_size, __MarshallingUtils.NativeUtf8FromString(text), cmdID);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = callback;
 }
Example #20
0
 public CKLBUITouchPad(CKLBTask parent, CallBack callback, bool modal = false)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUITouchPad_create(parent != null ? parent.CppObject : IntPtr.Zero, modal);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = callback;
 }
Example #21
0
 public CKLBStoreService(CallBack callback)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBStoreService_create();
     NativeManagement.intercepCppError();
     m_callback = callback;
     bind(ptr);
 }
Example #22
0
    public void SignUp(string name, CallBack callBack)
    {
        string url = host + "signup";
        WWWForm form = new WWWForm();
        form.AddField("PlayerName", name);
        WWW www = new WWW(url, form);

        StartCoroutine(WaitForRequest(www, callBack));
    }
Example #23
0
 public CKLBUIMoviePlayer(CKLBUITask parent, bool background_mode, float x, float y, float width, float height, CallBack callback, String url = null)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUIMoviePlayer_create(parent != null ? parent.CppObject : IntPtr.Zero, background_mode, x, y, width, height, __MarshallingUtils.NativeUtf8FromString(url));
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = callback;
 }
Example #24
0
 public CKLBUICanvas(CKLBUITask parent, uint order, float x, float y, uint vertexMax, uint indexMax, CallBack onDrawCallBack)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBUICanvas_create(parent != null ? parent.CppObject : IntPtr.Zero, order, x, y, vertexMax, indexMax);
     NativeManagement.intercepCppError();
     bind(ptr);
     m_callback = onDrawCallBack;
 }
Example #25
0
    // Constructor
    public TimedConfirm(string nText, float nTimeLeft, CallBack nYes, CallBack nNo = null)
        : base(nText, nYes, nNo)
    {
        timeStarted = Time.time;
        timeLeft = nTimeLeft;

        if(ToggleMouseLook.instance != null) {
            ToggleMouseLook.instance.DisableMouseLook(false);
        }
    }
Example #26
0
    //create a new item, name it, and set the parent
    private GameObject createNewItem(int num, int j, CallBack callback)
    {
        GameObject newItem = Instantiate(itemPrefab) as GameObject;

        newItem.tag = "TemporalPanel";
        newItem.name = gameObject.name + " item at (" + num + "," + j + ")";
        newItem.transform.SetParent (gameObject.transform);

        return callback (newItem, num);
    }
Example #27
0
    public void Init(string _title, string _content, CallBack _back)
    {
        Return.onClick.RemoveAllListeners();
        Return.onClick.AddListener(Back);

        Title = _title;
        Msg = _content;
        BackEvent = _back;
        gameObject.SetActive(true);
    }
Example #28
0
		private void SetCallback(CallBack pCallback)
		{
			ThrowIfDisposed();
			var r = _setCallback(pCallback);

			if (!r)
			{
				throw new ApiException(LocalizedStrings.Str3567);
			}
		}
 public CKLBAsyncLoader(CKLBTask pParent, String[] assets, uint datasetID, CallBack callback)
     : base(s_classID)
 {
     NativeManagement.resetCppError();
     IntPtr ptr = CKLBAsyncLoader_create((pParent != null) ? pParent.CppObject : IntPtr.Zero, 
                                          __MarshallingUtils.NativeUtf8ArrayFromStringArray(assets, assets.Length), (uint)assets.Length, datasetID);
     NativeManagement.intercepCppError();
     m_callback = callback;
     bind(ptr);
 }
    // GET from the server
    public void Get(string URL, CallBack callBack)
    {
        WWW response = new WWW (URL);

        state = State.Getting;

        StartCoroutine(
            MakeRequest(response,callBack)
        );
    }
Example #31
0
        /// <summary>
        /// 初始化画布
        /// </summary>
        /// <param name="bundleName">bundle名称</param>
        /// <param name="canvasName">画布名称</param>
        /// <param name="cb">加载完成回调</param>
        /// <param name="isSync">是否同步加载</param>
        /// <param name="keepBackCanvas">背后的画布是否可见</param>
        /// <param name="setVisible">加载完成后是否将该画布直接设为可见</param>
        public void SetUpCanvasWith(string bundleName, string canvasName, CallBack cb, bool isSync = false, bool keepBackCanvas = true, bool setVisible = true)
        {
            // 画布记录中不包括想要初始化的画布
            if (!UIDic.ContainsKey(canvasName))
            {
                // 画布字典遍历器
                IDictionaryEnumerator dicEnumerator = UIDic.GetEnumerator();

                // 同步加载
                if (isSync)
                {
                    // 如果背后的画布不保留,则遍历字典中的所有画布,全部设为不可见
                    if (!keepBackCanvas)
                    {
                        while (dicEnumerator.MoveNext())
                        {
                            Canvas canvas = (dicEnumerator.Value as Transform).GetComponent <Canvas>();
                            canvas.enabled = false;
                        }
                    }

                    // 从bundle中同步加载
                    GameObject[] assets = MyResourceManager.Instance.LoadAssets <GameObject> (bundleName);

                    Canvas c = null;

                    // 从bundle中加载出得资源中找到画布
                    foreach (GameObject asset in assets)
                    {
                        // 实例化
                        GameObject obj = Instantiate(asset);
                        obj.name = asset.name;
                        if (obj.name == canvasName)
                        {
                            c = obj.GetComponent <Canvas> ();
                            // 可见
                            if (setVisible)
                            {
                                c.enabled = true;
                            }
                        }
                    }

                    // 加载完成回调
                    if (cb != null)
                    {
                        cb();
                    }

                    // 将画布放置到场景中的画布容器下,方便管理
                    c.transform.SetParent(canvasContainer);
                    c.transform.SetAsLastSibling();

                    // 判断当前屏幕的宽高比,小于1.7的进行高度适配,大于1.7的进行宽度适配
                    if (CommonData.HWScalerOfCurrentScreen < 1.7f)
                    {
                        c.GetComponent <CanvasScaler>().matchWidthOrHeight = 1;
                    }
                    else
                    {
                        c.GetComponent <CanvasScaler>().matchWidthOrHeight = 0;
                    }

                    UIDic.Add(canvasName, c.transform);
                }
                else
                {
                    // 异步加载的协程
                    IEnumerator canvasCoroutine = SetUpCanvasAsync(bundleName, canvasName, cb, keepBackCanvas, setVisible);

                    StartCoroutine(canvasCoroutine);
                }
            }
            else
            {
                // 如果字典中已经有该画布的缓存
                IDictionaryEnumerator dicEnumerator = UIDic.GetEnumerator();
                // 设置其他画布是否可见
                while (dicEnumerator.MoveNext())
                {
                    Canvas c = (dicEnumerator.Value as Transform).GetComponent <Canvas> ();

                    if (dicEnumerator.Key as string == canvasName)
                    {
                        c.enabled = true;
                        c.transform.SetAsLastSibling();
                    }
                    else
                    {
                        c.enabled = c.enabled && keepBackCanvas;
                    }
                }

                if (cb != null)
                {
                    cb();
                }
            }
        }
Example #32
0
        public override IEnumerator LoadAssetsIEnumerator(string path, System.Type resType, CallBack <AssetsData> callBack)
        {
            AssetsData      rds = null;
            string          s   = PathTool.RemoveExtension(path);
            ResourceRequest ass = null;

            if (resType != null)
            {
                ass = Resources.LoadAsync(s, resType);
            }
            else
            {
                ass = Resources.LoadAsync(s);
            }
            yield return(ass);

            if (ass.asset != null)
            {
                rds        = new AssetsData(path);
                rds.Assets = new UnityEngine.Object[] { ass.asset };
            }
            else
            {
                Debug.LogError("加载失败,Path:" + path);
            }

            if (callBack != null)
            {
                callBack(rds);
            }
            yield return(new WaitForEndOfFrame());
        }
Example #33
0
 public static void add(float delay, CallBack handler, bool once = true, bool ignoretimescale = true)
 {
     add(null, delay, handler, once, ignoretimescale);
 }
Example #34
0
    //淡出
    public static void FadeOut(float fadeTime, CallBack completeCallBack = null, bool isForceAlpha = false, float delay = 0)
    {
        CameraFadeData data = GetCameraFadeData(CameraFadeType.FadeOut, isForceAlpha, delay, fadeTime, completeCallBack);

        Instance.StartFadeFunc(data);
    }
Example #35
0
    //===========================================================
    //                        添加监听
    //===========================================================

    // 不带参数
    public static void AddListener(EventType eventType, CallBack callBack)
    {
        OnListenerAdding(eventType, callBack);
        m_EventTable[eventType] = (CallBack)m_EventTable[eventType] + callBack; // 多播
    }
Example #36
0
        public void SetUpQuizResultView(WordRecordQuizResult result, CallBack confirmResultCallBack)
        {
            this.confirmResultCallBack = confirmResultCallBack;

            int quizWordCount = result.correctWordsCount + result.wrongWordsCount;

            generalInfoText.text = string.Format("<color=orange>复习单词数: {0}个</color>\n正确单词数: {1}个\n错误单词数: {2}个",
                                                 quizWordCount, result.correctWordsCount, result.wrongWordsCount);


            correctPercentageText.text = string.Format("  正确率:\n<color=white><size=70>{0}%</size></color>",
                                                       result.correctWordsCount * 100 / quizWordCount);

            healthGainText.text = string.Format("+{0}", result.healthGainTotal);

            manaGainText.text = string.Format("+{0}", result.manaGainTotal);

            maxContinousHitText.text = string.Format("最高连击数: {0}", result.maxContinousHitCount);

            int   attackGain      = 0;
            int   magicAttackGain = 0;
            int   armorGain       = 0;
            int   magicResistGain = 0;
            float dodgeGain       = 0;
            float critGain        = 0;

            for (int i = 0; i < result.extraPropertySets.Count; i++)
            {
                PropertySet ps = result.extraPropertySets[i];

                switch (ps.type)
                {
                case PropertyType.Attack:
                    attackGain += Mathf.RoundToInt(ps.value);
                    break;

                case PropertyType.MagicAttack:
                    magicAttackGain += Mathf.RoundToInt(ps.value);
                    break;

                case PropertyType.Armor:
                    armorGain += Mathf.RoundToInt(ps.value);
                    break;

                case PropertyType.MagicResist:
                    magicResistGain += Mathf.RoundToInt(ps.value);
                    break;

                case PropertyType.Dodge:
                    dodgeGain += ps.value;
                    break;

                case PropertyType.Crit:
                    critGain += ps.value;
                    break;
                }
            }

            Player.mainPlayer.health += result.healthGainTotal;
            Player.mainPlayer.mana   += result.manaGainTotal;

            ExploreManager.Instance.UpdatePlayerStatusPlane();



            if (attackGain > 0)
            {
                attackGainText.text               = string.Format("+{0}", attackGain);
                Player.mainPlayer.attack         += attackGain;
                Player.mainPlayer.originalAttack += attackGain;
            }
            else
            {
                attackGainText.text = "--";
            }

            if (magicAttackGain > 0)
            {
                magicAttackGainText.text               = string.Format("+{0}", magicAttackGain);
                Player.mainPlayer.magicAttack         += magicAttackGain;
                Player.mainPlayer.originalMagicAttack += magicAttackGain;
            }
            else
            {
                magicAttackGainText.text = "--";
            }

            if (armorGain > 0)
            {
                armorGainText.text               = string.Format("+{0}", armorGain);
                Player.mainPlayer.armor         += armorGain;
                Player.mainPlayer.originalArmor += armorGain;
            }
            else
            {
                armorGainText.text = "--";
            }

            if (magicResistGain > 0)
            {
                magicResistGainText.text               = string.Format("+{0}", magicResistGain);
                Player.mainPlayer.magicResist         += magicResistGain;
                Player.mainPlayer.originalMagicResist += magicResistGain;
            }
            else
            {
                magicResistGainText.text = "--";
            }

            if (dodgeGain > float.Epsilon)
            {
                dodgeGainText.text               = string.Format("+{0}%", ((dodgeGain + float.Epsilon) * 100).ToString("0.0"));
                Player.mainPlayer.dodge         += dodgeGain;
                Player.mainPlayer.originalDodge += dodgeGain;
            }
            else
            {
                dodgeGainText.text = "--";
            }

            if (critGain > float.Epsilon)
            {
                critGainText.text               = string.Format("+{0}%", ((critGain + float.Epsilon) * 100).ToString("0.0"));
                Player.mainPlayer.crit         += critGain;
                Player.mainPlayer.originalCrit += critGain;
            }
            else
            {
                critGainText.text = "--";
            }

            this.gameObject.SetActive(true);

            GameManager.Instance.soundManager.PlayAudioClip(CommonData.paperAudioName);


            if (zoomCoroutine != null)
            {
                StopCoroutine(zoomCoroutine);
            }

            zoomCoroutine = HUDZoomIn();

            StartCoroutine(zoomCoroutine);
        }
    /// <summary>
    /// 打开窗口
    /// </summary>
    /// <param name="title">标题</param>
    /// <param name="value">希望修改的数据</param>
    /// <param name="customDrawGUI">自定义GUI绘制</param>
    /// <param name="checkCanOkButtonCallBack">检查是否能使用"OK"按钮</param>
    /// <param name="modificationCompleteCallBack">完成修改回调</param>
    public static void OpenWindow(EditorWindow otherWindow, string title, object value, CallBackR <object, object> customDrawGUI, CallBackR <bool, object> checkCanOkButtonCallBack, CallBack <object> modificationCompleteCallBack)
    {
        win = GetWindow <GeneralDataModificationWindow>();
        win.wantsMouseMove           = true;
        win.autoRepaintOnSceneChange = true;
        win.otherWindow = otherWindow;
        FocusWindowIfItsOpen <GeneralDataModificationWindow>();

        win.m_Title      = title;
        win.value        = value;
        win.modifi_Value = value;//.DeepCopySelf();

        win.customDrawGUI = customDrawGUI;
        win.modificationCompleteCallBack = modificationCompleteCallBack;
        win.checkCanOkButtonCallBack     = checkCanOkButtonCallBack;
    }
Example #38
0
 public static extern int EnumChildWindows(IntPtr hWndParent, CallBack lpfn, int lParam);
    /// <summary>
    /// 战斗类型10人或替补之类  是否pvp 是否boss战
    /// </summary>
    public void Initialize(int mode, bool isPvP, bool isBossBattle, CallBack battleCallback)
    {
        if (isPvP)
        {
            savingArmy = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(3));
            oldArmy    = ArmyManager.Instance.getArmy(3);
        }
        else
        {
            savingArmy = ArmyManager.Instance.DeepClone(ArmyManager.Instance.getArmy(1));
            oldArmy    = ArmyManager.Instance.getArmy(1);
        }

        this.isPvP        = isPvP;
        this.doBattle     = battleCallback;
        battleMode        = mode;
        this.isBossBattle = isBossBattle;

        if (isPvP)
        {
            playerFormationData = PvpInfoManagerment.Instance.getUserBFCards();
            enemyFormationData  = PvpInfoManagerment.Instance.getBattleFormationCards();
        }
        else
        {
            playerFormationData = MissionInfoManager.Instance.mission.mine;
            enemyFormationData  = MissionInfoManager.Instance.mission.enemy;
        }

        if (battleMode == BattleType.BATTLE_FIVE)
        {
            player10v10Root.SetActive(false);
            enemy10v10Root.SetActive(false);
            buttonBoss.gameObject.SetActive(false);
            player5v5Root.SetActive(true);
            enemy5v5Root.SetActive(true);

            activePlayerParter = buttonPlayerParter5v5;
            activeEnemyParter  = buttonEnemyParter5v5;
        }
        else if (battleMode == BattleType.BATTLE_SUBSTITUTE)
        {
            player5v5Root.SetActive(false);
            enemy5v5Root.SetActive(false);
            buttonBoss.gameObject.SetActive(false);
            player10v10Root.SetActive(true);
            enemy10v10Root.SetActive(true);
            activePlayerParter = buttonPlayerParter10v10;
            activeEnemyParter  = buttonEnemyParter10v10;
        }
        else if (battleMode == BattleType.BATTLE_FIVE && isBossBattle)
        {
            player10v10Root.SetActive(false);
            enemy10v10Root.SetActive(false);
            enemy5v5Root.SetActive(false);
            buttonBoss.gameObject.SetActive(true);
            player5v5Root.SetActive(true);
            activePlayerParter = buttonPlayerParter5v5;
        }
        else if (battleMode == BattleType.BATTLE_SUBSTITUTE && isBossBattle)
        {
            player5v5Root.SetActive(false);
            enemy5v5Root.SetActive(false);
            enemy10v10Root.SetActive(false);
            buttonBoss.gameObject.SetActive(true);
            player10v10Root.SetActive(true);

            activePlayerParter = buttonPlayerParter10v10;
        }
        else if (battleMode == BattleType.BATTLE_TEN && !isBossBattle)
        {
            player5v5Root.SetActive(false);
            enemy5v5Root.SetActive(false);
            buttonBoss.gameObject.SetActive(false);
            player10v10Root.SetActive(true);
            enemy10v10Root.SetActive(true);
            activePlayerParter = buttonPlayerParter10v10;
            activeEnemyParter  = buttonEnemyParter10v10;
        }
        else if (battleMode == BattleType.BATTLE_TEN && isBossBattle)
        {
            player5v5Root.SetActive(false);
            enemy5v5Root.SetActive(false);
            enemy10v10Root.SetActive(false);
            buttonBoss.gameObject.SetActive(true);
            player10v10Root.SetActive(true);
            activePlayerParter = buttonPlayerParter10v10;
        }

        //更新战斗按钮文字
        if (battleMode == BattleType.BATTLE_SUBSTITUTE)
        {
            ButtonBattleStart.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0186");
        }
        else if (battleMode == BattleType.BATTLE_TEN)
        {
            //只有10v10人才有资格叫 大乱斗
            ButtonBattleStart.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0191");
        }
        else
        {
            ButtonBattleStart.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0187");
        }
        initTeam();
        TeamEmtpyInfoFPort fport = FPortManager.Instance.getFPort <TeamEmtpyInfoFPort> ();

        fport.access(openEmptyForLevelNewBack);
    }
Example #40
0
 public static extern int csInit(CallBack cb, int w, int h);
Example #41
0
    public static void LoadAsync(string name, Type resType, CallBack <Object> callBack)
    {
        string path = ResourcesConfigManager.GetLoadPath(loadType, name);

        loadAssetsController.LoadAsync(path, resType, callBack);
    }
Example #42
0
 public void init(CallBack _callBack)
 {
     fatherCallBackFun = _callBack;
 }
 public void InitSmallDetect(CallBack characterFlyCalBk)
 {
     this.characterFlyCalBk = characterFlyCalBk;
 }
Example #44
0
    //从淡入到淡出
    public static void FadeInToOut(float _fadeInTime, float afterInDelayTime, float _fadeOutTime, CallBack afterFadeInCallback = null, CallBack afterFadeOutCallback = null, float delay = 0, bool isForceAlpha = false)
    {
        CameraFadeData data  = GetCameraFadeData(CameraFadeType.FadeIn, isForceAlpha, delay, _fadeInTime, afterFadeInCallback);
        CameraFadeData data2 = GetCameraFadeData(CameraFadeType.FadeOut, isForceAlpha, afterInDelayTime, _fadeOutTime, afterFadeOutCallback);

        Instance.StartFadeFunc(data, data2);
    }
Example #45
0
 // 3 个参数
 public static void AddListener <T, X, Y>(EventType eventType, CallBack <T, X, Y> callBack)
 {
     OnListenerAdding(eventType, callBack);
     m_EventTable[eventType] = (CallBack <T, X, Y>)m_EventTable[eventType] + callBack;
 }
Example #46
0
        /// <summary>
        /// 移除事件
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="callBack"></param>
        public void RemoveListener(Enum eventType, CallBack callBack)
        {
            int id = Convert.ToInt32(eventType);

            RemoveListener(id, callBack);
        }
Example #47
0
 public static extern bool EnumWindows(CallBack cb, IntPtr param);
Example #48
0
 // 5 个参数
 public static void RemoveListener <T, X, Y, Z, W>(EventType eventType, CallBack <T, X, Y, Z, W> callBack)
 {
     OnListenerRemoving(eventType, callBack);
     m_EventTable[eventType] = (CallBack <T, X, Y, Z, W>)m_EventTable[eventType] - callBack;
     OnListenerRemoved(eventType);
 }
Example #49
0
 [DllImport("user32.dll")] public static extern int EnumWindows(CallBack x, int y);
 public override void setDelegate(Delegate anyDelegate, String delegateName = null)
 {
     m_callback = (CallBack)anyDelegate;
 }
Example #51
0
 public static extern bool EnumWindows(CallBack lCallBack, int lParam);
Example #52
0
 public CameraFadeData(CameraFadeType fadeType, bool isForceAlpha, float delay, float fadeTime, CallBack completeCallBack)
 {
     SetCameraFadeData(fadeType, isForceAlpha, delay, fadeTime, completeCallBack);
 }
        public CKLBUITextInput(CKLBUITask parent, bool passwordMode, int x, int y, uint width, uint height, String defaultText, CallBack callback,
                               int widgetId = 0, int maxLen = 0, uint charType = (uint)(ECHAR_TYPE.TXCH_7BIT_ASCII | ECHAR_TYPE.TXCH_UTF8))
            : base(s_classID)
        {
            NativeManagement.resetCppError();
            IntPtr ptr = CKLBUITextInput_create(parent != null ? parent.CppObject : IntPtr.Zero, passwordMode, x, y, width, height, __MarshallingUtils.NativeUtf8FromString(defaultText), widgetId, maxLen, charType);

            NativeManagement.intercepCppError();
            bind(ptr);
            m_callback = callback;
        }
Example #54
0
        public void SetCameraFadeData(CameraFadeType fadeType, bool isForceAlpha, float delay, float fadeTime, CallBack completeCallBack)
        {
            this.fadeType         = fadeType;
            this.isForceAlpha     = isForceAlpha;
            this.delay            = delay;
            this.fadeTime         = fadeTime;
            this.completeCallBack = completeCallBack;

            tempFadeCaculateTime = fadeTime;
        }
Example #55
0
    public void parseKVMsg(ErlKVMessage message)
    {
        ErlList data = message.getValue("msg") as ErlList;

        if (data == null)
        {
            string msg = (message.getValue("msg") as ErlType).getValueString();
            SweepManagement.Instance.clearData();
            if (callback != null)
            {
                callback();
                callback = null;
            }
            return;
        }
        int sweepTimes        = 0;
        int sweepCDTime       = 0;
        int sweepMissionSid   = 0;
        int sweepMissionLevel = 0;
        int state             = 0;
        int startTime         = 0;
        int pvpCount          = 0;
        int arrayID           = 0;

        int      length = data.Value.Length;
        ErlArray itemArray;
        string   key;
        int      value;

        for (int i = 0; i < length; i++)
        {
            itemArray = data.Value[i] as ErlArray;
            key       = itemArray.Value[0].getValueString();
            value     = StringKit.toInt(itemArray.Value[1].getValueString());
            switch (key)
            {
            case "pvp_num":
                pvpCount = value;
                break;

            case "start_time":
                startTime = value;
                break;

            case "cd":
                sweepCDTime = value;
                break;

            case "sweep_num":
                sweepTimes = value;
                break;

            case "fb_id":
                sweepMissionSid = value;
                break;

            case "fb_lv":
                sweepMissionLevel = value;
                break;

            case "state":
                state = value;
                break;

            case "array_id":
                arrayID = value;
                break;
            }
        }
        SweepManagement.Instance.initPvpNum(pvpCount);
        SweepManagement.Instance.SweepCostTime = sweepCDTime;
        SweepManagement.Instance.M_updateSweepInfo(state, sweepMissionSid, sweepMissionLevel, sweepTimes, startTime, arrayID);
    }
Example #56
0
    private static CameraFadeData GetCameraFadeData(CameraFadeType fadeType, bool isForceAlpha, float delay, float fadeTime, CallBack completeCallBack)
    {
        CameraFadeData data = null;

        if (cacheData.Count > 0)
        {
            data = cacheData[0];
            cacheData.RemoveAt(0);
        }
        else
        {
            data = new CameraFadeData();
        }
        data.SetCameraFadeData(fadeType, isForceAlpha, delay, fadeTime, completeCallBack);
        return(data);
    }
Example #57
0
 public static void RemoveUpdate(CallBack handler)
 {
     m_CallBackUpdateList.Remove(handler);
 }
Example #58
0
    //===========================================================
    //                        移除监听
    //===========================================================

    // 不带参数
    public static void RemoveListener(EventType eventType, CallBack callBack)
    {
        OnListenerRemoving(eventType, callBack);
        m_EventTable[eventType] = (CallBack)m_EventTable[eventType] - callBack; // 移除委托
        OnListenerRemoved(eventType);
    }
Example #59
0
        public void SetUpLevelTransportView(HLHNPC npc, LevelTransportSelectCallBack levelSelectCallBack, CallBack quitCallBack)
        {
            this.levelSelectCallBack = levelSelectCallBack;
            this.quitCallBack        = quitCallBack;

            this.gameObject.SetActive(true);

            List <int> validTravelLevelIds = npc.GetValidTravelLevelIds();

            levelChoiceContainer.localPosition = Vector3.zero;

            levelChoicePool.AddChildInstancesToPool(levelChoiceContainer);

            bool hasValidTranportLevel = validTravelLevelIds.Count > 0;

            for (int i = 0; i < validTravelLevelIds.Count; i++)
            {
                int transportLevel = validTravelLevelIds[i];

                Button levelChoice = levelChoicePool.GetInstance <Button>(levelChoiceModel.gameObject, levelChoiceContainer);

                levelChoice.GetComponentInChildren <Text>().text = string.Format("第{0}层", transportLevel + 1);

                levelChoice.onClick.RemoveAllListeners();

                levelChoice.onClick.AddListener(delegate
                {
                    if (Player.mainPlayer.totalGold < transportCost)
                    {
                        tintHUD.SetUpSingleTextTintHUD("金币不足");
                        return;
                    }

                    Player.mainPlayer.totalGold -= transportCost;

                    GameManager.Instance.gameDataCenter.currentMapEventsRecord.Reset();
                    GameManager.Instance.persistDataManager.ClearCurrentMapWordsRecordAndSave();

                    if (levelSelectCallBack != null)
                    {
                        levelSelectCallBack(transportLevel);
                    }

                    this.gameObject.SetActive(false);
                });
            }


            noValidLevelHint.enabled = !hasValidTranportLevel;
            //upButton.gameObject.SetActive(hasValidTranportLevel);
            //downButton.gameObject.SetActive(hasValidTranportLevel);

            if (zoomCoroutine != null)
            {
                StopCoroutine(zoomCoroutine);
            }

            zoomCoroutine = HUDZoomIn();

            StartCoroutine(zoomCoroutine);
        }
Example #60
0
        public static IEnumerator MoveCardsOnBoard(CardObject card, Vector3 destination, float speed = 1000, CallBack callBack = null,
                                                   VerticalColumn column = null)
        {
            while (Vector3.Distance(card.transform.position, destination) >= 5)
            {
                card.transform.position = Vector3.MoveTowards(card.transform.position, destination, Time.deltaTime * speed);
                yield return(new WaitForSeconds(0.02f));
            }

            card.transform.position = destination;
            callBack?.Invoke(card, column);
        }