Ejemplo n.º 1
0
	/// <summary>
	/// 事件回调函数
	/// </summary>
	/// <param name="uEvent">U event.</param>
	private void OnClickHandler(UEvent uEvent)
	{
		this.targetPosition = this.targetPosition == 2f ? -2f : 2f;
		
		this.StopCoroutine (this.PositionOperater ());
		this.StartCoroutine (this.PositionOperater());
	}
Ejemplo n.º 2
0
 public void Excute(UEvent evt)
 {
     if (OnEvent != null)
     {
         this.OnEvent(evt);
     }
 }
Ejemplo n.º 3
0
 //void RemoveSelf(UEvent e)
 //{
 //    DestroyImmediate(this, true);
 //}
 void JiaXue(UEvent e)
 {
     this.live += 300;
     if (this.live > maxLive) live = maxLive;
     if(IsHasZZ) if (live > maxLive * 0.3f) live = maxLive * 0.3f;
     GetTX("jiaxue");
 }
Ejemplo n.º 4
0
	private void OnClickHandler(UEvent uEvent)
	{
		this.targetAngle = this.targetAngle == 90f ? 0f : 90f;

		this.StopCoroutine (this.RotationOperater ());
		this.StartCoroutine (this.RotationOperater());
	}
Ejemplo n.º 5
0
    /// <summary>
    /// 事件回调函数
    /// </summary>
    /// <param name="uEvent">U event.</param>
    private void OnClickHandler(UEvent uEvent)
    {
        this.targetPosition = this.targetPosition == 2f ? -2f : 2f;

        this.StopCoroutine(this.PositionOperater());
        this.StartCoroutine(this.PositionOperater());
    }
Ejemplo n.º 6
0
 public void Excute(UEvent evt)
 {
     if (OnEvent != null)
     {
         this.OnEvent (evt);
     }
 }
Ejemplo n.º 7
0
    void DieOut(UEvent e)
    {
        if (e.eventParams == null)
        {
            return;
        }
        //print(e.eventParams.ToString());
        //print((e.target as GameObject).name);
        //print(" yy  audio -------- "+ e.eventParams.ToString());
        if (e.eventParams.ToString() == GlobalTag.Player)
        {
            if (IsPlayerDieGraduaMin)
            {
                //玩家die音量 渐隐
                IsPlayerDieGraduaMining = true;
            }
        }

        if (e.eventParams.ToString() == GlobalTag.BOSS && IsBossFIGHTAudioDown)
        {
            IsPlayerDieGraduaMining = true;
            return;
        }


        if (e.eventParams.ToString() == GlobalTag.JINGYING)
        {
            IsPlayerDieGraduaMining = true;
        }
    }
Ejemplo n.º 8
0
    void GetChoseEvent(UEvent e)
    {
        ChoseEventStr = e.eventParams.ToString();
        print(" ------ choseEventName    " + e.eventParams.ToString());

        //加一个 不删除 自身的 事件
        string eventName = ChoseEventStr.Split('*')[0];


        if (eventName == "openDoor")
        {
            if (NPC)
            {
                NPC.GetComponent <RoleDate>().isCanBeHit = true;
            }
        }

        if (eventName == "startfight")
        {
            ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.NEW_OPEN_DOOR, "close"), this);
            if (NPC)
            {
                NPC.GetComponent <RoleDate>().isCanBeHit = true;
            }
        }


        //event$dontRemove
        if (eventName == "dontRemove")
        {
            IsOverMoveSelf     = false;
            IsCanBeHit         = false;
            IsNeedRecordByOver = false;
            return;
        }

        //记录关卡 剧情 记录的 事件
        if (eventName == "jianding")
        {
            if (ChoseEventStr.Split('*')[1] == "1")
            {
                //二次不会碰撞 不能消失
                IsOverMoveSelf     = false;
                IsCanBeHit         = false;
                IsNeedRecordByOver = false;
                //选择的 是坚定
                //存入全局数据 是坚定  无法显示 跳跃关卡 存档点


                print("选择的 是 坚定!!!!!!   选的 是徽章 ");
            }
            else
            {
                //选择的是 不坚定  现在 谈话结束后 可以消失
                print("选择的是 不 坚定!!   选择神树!!!");
            }
            GlobalSetDate.instance.SaveInOtherDate(ChoseEventStr);
        }
    }
Ejemplo n.º 9
0
 private void OnVictory(UEvent evt)
 {
     // Debug.Log(" Mask OnVictory ");
     if (_status == 0)
     {
         _status = 1;
     }
 }
Ejemplo n.º 10
0
 void ScreenChange(UEvent e)
 {
     //print("??????????? 切换场景!!!! ");
     if (m_AudioSource)
     {
         m_AudioSource.Stop();
     }
 }
Ejemplo n.º 11
0
 public void audioValue(UEvent e)
 {
     if (!IsGradualValue && m_AudioSource)
     {
         CVolume = GlobalSetDate.instance.GetSoundEffectValue();
         m_AudioSource.volume = CVolume;
     }
 }
Ejemplo n.º 12
0
 /**
  * 点击了遮罩
  * */
 private void PanelMaskClickHandler(UEvent uEvent)
 {
     if (isBeting == false)
     {
         cleanResultInfo(null);
         PopMaskMaskManager.hide();
     }
 }
Ejemplo n.º 13
0
 void GetJGEvent(UEvent e)
 {
     if (e.eventParams.ToString() == MOVE_DB_ZU)
     {
         _theTime.TimesAdd(1, CallBack2);
         //_theTime.ContinuouslyTimesAdd(8 , 1, CallBack);
     }
 }
Ejemplo n.º 14
0
    void GetDiaoLuo(UEvent e)
    {
        if (isDie)
        {
            return;
        }
        //print("------------------------------->>    "+e.eventParams.ToString());
        if (e.eventParams.ToString() == "XuehunXiao")
        {
            this.live += 100;
            GetTX("jiaxue");
        }
        else if (e.eventParams.ToString() == "XuehunDa")
        {
            this.live += 500;
            GetTX("jiaxue");
        }
        else if (e.eventParams.ToString() == "LanhunXiao")
        {
            this.lan += 100;
            GetTX("jialan");
        }
        else if (e.eventParams.ToString() == "LanhunDa")
        {
            this.lan += 500;
            GetTX("jialan");
        }
        else if (e.eventParams.ToString() == "C_cundangdian")
        {
            print("存档点加血");
            this.live += 5000;
            GetTX("jiaxue");
            this.lan += 5000;

            //存档点 加不加蓝 看设计
        }
        if (!IsHasZZ)
        {
            if (live > maxLive)
            {
                live = maxLive;
            }
        }
        else
        {
            //print(live+"  max  "+ maxLive);
            if (live > maxLive * 0.3f)
            {
                live = maxLive * 0.3f;
            }
            //print(live + "  max2222  " + maxLive);
        }

        if (lan > maxLan)
        {
            lan = maxLan;
        }
    }
Ejemplo n.º 15
0
 private void IsAllOver(UEvent evt)
 {
     //throw new NotImplementedException();
     print("bossdie");
     IsEnd = true;
     if (evt.eventParams.ToString() == "B_huolong")
     {
     }
 }
Ejemplo n.º 16
0
 public void Excute(UEvent evt)
 {
     if (OnEvent != null)
     {
         //System.Diagnostics.Debug.Print(this+ "    "+evt);
         //Console.WriteLine(this + "  event>  " + evt);
         this.OnEvent(evt);
     }
 }
Ejemplo n.º 17
0
        // Auto Listen

        public void Test01()
        {
            var evt = new ClassEventDefine()
            {
                Message = "Message 01"
            };

            UEvent <ClassEventDefine> .Dispatch(evt);
        }
Ejemplo n.º 18
0
    private void OnOneKey(UEvent evt)
    {
        Debug.Log("OnOneKey");
        //查找到点击的关卡
        UserDataManager.GetInstance().OneKeyOpen();
        UserChapter uc = UserDataManager.GetInstance().GetUserData().GetUserChapter(_chapter.ChapterId);

        LoadChapter(uc);
    }
Ejemplo n.º 19
0
    void RemoveSelfAndRestart(UEvent e)
    {
        //UI内的 其他子组件  侦听  没有把代码写到 主PlayerUI组件上 不会自动 调用销毁  OnDistory   这里就必须手动调用  或者 改写到主UI上********************注意

        //DestroyImmediate 立即销毁  Destroy是异步销毁
        DestroyImmediate(this.gameObject, true);
        //Destroy(this.gameObject);
        GlobalSetDate.instance.GetGameDateStart();
    }
Ejemplo n.º 20
0
 private static void clickHandle(GameObject go)
 {
     if (go == panelMaskBehaviours.gameObject)
     {
         Echo.Log("点击了遮罩");            //点击了遮罩
         UEvent ev = new UEvent(EventName.PanelMask_CLICK, null);
         EventProtocol.dispatcher.dispatchEvent(ev, go);
     }
 }
Ejemplo n.º 21
0
 private void OnTargetClick(UEvent evt)
 {
     _targetObject = (GameObject)evt.target;
     // if (_starAniCount == 0 && _victoryStatus == 0){
     //     //开始播放
     //     _victoryStatus = 1;
     //     Debug.Log("OnTargetClick _victoryStatus=" + _victoryStatus);
     // }
 }
Ejemplo n.º 22
0
        // Auto Listen

        public void Test01()
        {
            var evt = new StructEventDefine()
            {
                Message = "Message 01"
            };

            UEvent <StructEventDefine> .Dispatch(evt);
        }
Ejemplo n.º 23
0
    public static void TriggerEvent(string eventName, System.Object param)
    {
        UEvent thisEvent = null;

        if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(param);
        }
    }
Ejemplo n.º 24
0
 private void GetJinggao(UEvent evt)
 {
     IsInJinggao  = true;
     jinggaoJishi = 0;
     Jinggao.gameObject.SetActive(true);
     if (!Audio_Jinggao.isPlaying)
     {
         Audio_Jinggao.Play();
     }
 }
Ejemplo n.º 25
0
 void OnChildEvent(UEvent uEvent)
 {
     if (onEvent != null)
     {
         onEvent(new UEvent
         {
             eventType = uEvent.eventType, owner = this, sender = uEvent.sender, value = uEvent.value
         });
     }
 }
Ejemplo n.º 26
0
 private void ChengjiuE(UEvent evt)
 {
     if (SteamManager.Initialized)
     {
         //string name = SteamFriends.GetPersonaName();
         string cj = evt.eventParams.ToString();
         Debug.Log("steam connect....  cj name  " + cj);
         SteamUserStats.SetAchievement(cj);
     }
 }
Ejemplo n.º 27
0
    //初始化 隐藏自己
    //接受到出现boss缓动显示 并且获取boss信息 与其关联
    void ShowSelf(UEvent e)
    {
        //print("show bar!!!");
        //this.gameObject.SetActive(true);
        string bossName = e.eventParams.ToString();

        isShowSelf = true;
        this.GetComponent <EnemyXueTiao>().gameObj = GlobalTools.FindObjByName(bossName);
        this.GetComponent <EnemyXueTiao>().GetGameObj();
    }
Ejemplo n.º 28
0
    /// <summary>
    /// 发送事件
    /// </summary>
    /// <param name="evt">Evt.</param>
    /// <param name="gameObject">Game object.</param>
    public void dispatchEvent(UEvent evt, object gameObject)
    {
        IList <UEventListener> resultList = this.getListenerList(evt.eventType);

        foreach (UEventListener eventListener in resultList)
        {
            evt.target = gameObject;

            eventListener.Excute(evt);
        }
    }
Ejemplo n.º 29
0
	/// <summary>
	/// 发送事件
	/// </summary>
	/// <param name="evt">Evt.</param>
	/// <param name="gameObject">Game object.</param>
	public void dispatchEvent(UEvent evt, object gameObject)
	{
		IList<UEventListener> resultList = this.getListenerList (evt.eventType);

		foreach (UEventListener eventListener in resultList) 
		{
			evt.target = gameObject;

			eventListener.Excute(evt);
		}
	}
Ejemplo n.º 30
0
 //场景切换 跟随的 血条直接到位置
 public void GenSuiXuetiaoW2ToPos(UEvent e)
 {
     if (!IsPlayerXuetiao)
     {
         return;
     }
     //print("血条 直接 跟随!!!"+_w2+"   w "+_w+"  血量 "+ roleDate.live);
     XueChange();
     _w2 = _w;
     Wh(xue2, _w2, _h);
 }
Ejemplo n.º 31
0
        // Manual Listen

        public void Test02()
        {
            UEvent.Listen <ClassEventDefine>(Receive02);

            UEvent.Dispatch(new ClassEventDefine()
            {
                Message = "Message 02"
            });

            UEvent.Remove <ClassEventDefine>(Receive02);
        }
Ejemplo n.º 32
0
 public void FoodChange(UEvent food)
 {
     //ZDebug.Log (food.eventParams.ToString());
     Food += (int) food.eventParams;
     if(Food<=0){
         isLose = true;
         Invoke ("ReStart",3f);
     }
     ZDebug.Log ("Food  = "+Food);
     ObjectEventDispatcher.dispatcher.dispatchEvent (new UEvent(EventTypeName.UI_UPDATE,""),this);
 }
Ejemplo n.º 33
0
    private void playerDie(UEvent evt)
    {
        //这个 防止 别的怪  打败玩家  触发    只能是 boss打败玩家  才能触发

        if (GetComponent <RoleDate>().isDie)
        {
            ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.PLOT_KILL_PLAYER), this);
            return;
        }


        if (GetComponent <AIBase>().IsBossStop)
        {
            return;
        }



        ObjectEventDispatcher.dispatcher.dispatchEvent(new UEvent(EventTypeName.PLOT_KILL_PLAYER), this);



        //if (evt.eventParams != null) print("dieout---------------------------------------------@@   "+evt.eventParams.ToString());
        if (evt.eventParams != null && evt.eventParams.ToString() == "Player")
        {
            GetComponent <AIBase>().isPlayerDie = true;

            //击败玩家  是否 就离开消失  存入数据中

            if (AudioPlayerDie)
            {
                AudioPlayerDie.Play();
            }

            if (IsHasChaofeng && ChaoFengStrArr != null)
            {
                if (ChaoFengStrArr.Length < 3)
                {
                    if (GlobalTools.GetRandomNum() < 50)
                    {
                        return;
                    }
                }

                StartCoroutine(ShowOutTxtBar(0.5f));
            }

            //Globals.isPlayerDie = true;
            //GetComponent<GameBody>().ResetAll();
            //if(GetComponent<GameBody>().GetDB().animation.lastAnimationName!="stand_1")GetComponent<GameBody>().GetStand();
            //print("palyer is die !!!!!!!!!");
            //GetComponent<GameBody>().GetStand();
        }
    }
Ejemplo n.º 34
0
    protected virtual void ZDSkillShow(UEvent e)
    {
        print("--------------------------->" + e.eventParams.ToString());
        GetZSName = "";
        //e.eventParams.ToString() ->  12345@ZD_lz_ZDDiu3Huo_1
        string[] strArr = e.eventParams.ToString().Split('@');
        //主动AI的 全名 包含参数
        ZDAIName = strArr[1];
        //ZD_lz_ZDDiu3Huo_1
        string id = strArr[0];

        if (ZDAIName.Split('_')[1] == "lz")
        {
            GetZSName       = ZDAIName.Split('_')[2];
            IsCanZhuanxiang = false;
        }
        else
        {
            GetZSName       = ZDAIName.Split('_')[1];
            IsCanZhuanxiang = true;
        }

        string[] sArr = ZDAIName.Split('_');
        string   s    = "";

        for (int i = 0; i < sArr.Length; i++)
        {
            if (sArr[i] != "lz")
            {
                if (i == 0)
                {
                    s = sArr[i];
                }
                else
                {
                    s += "_" + sArr[i];
                }
            }
        }

        print("  ZDAIName  " + ZDAIName);
        ZDAIName = s;
        if (ZDAIName.Split('_').Length >= 3)
        {
            SkillType = ZDAIName.Split('_')[2];
        }
        //print("zd 自动技能 释放 接收 参数 " + e.eventParams.ToString() + "   本技能名字  " + ZSName+ " GetZSName   "+ GetZSName);

        if (id == this.gameObject.GetInstanceID().ToString() && GetZSName == ZSName)
        {
            //print("zd 发动技能  " + ZSName);
            GetStart(null);
        }
    }
Ejemplo n.º 35
0
        // Manual Listen

        public void Test02()
        {
            UEvent <StructEventDefine> .Listen(Receive02);

            UEvent <StructEventDefine> .Dispatch(new StructEventDefine()
            {
                Message = "Message 02"
            });

            UEvent <StructEventDefine> .Remove(Receive02);
        }
Ejemplo n.º 36
0
 public static int constructor(IntPtr l)
 {
     try {
         UEvent o;
         System.String a1;
         checkType(l,2,out a1);
         System.Object a2;
         checkType(l,3,out a2);
         o=new UEvent(a1,a2);
         pushValue(l,true);
         pushValue(l,o);
         return 2;
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
Ejemplo n.º 37
0
 private void RefreshUI(UEvent evt)
 {
     foodLabel.text = "Food : "+GameManager.GetInstance ().Food+"";
     exitLabel.text = "Level : "+GameManager.GetInstance ().Level+"";
     loseLabel.gameObject.SetActive (GameManager.GetInstance().isLose);
 }