void Start() { //Const.CONST_ENERGY_RECOVER_TIME = 1; InvokeRepeating("AddEnergy", Const.CONST_ENERGY_RECOVER_TIME, Const.CONST_ENERGY_RECOVER_TIME); InvokeRepeating("UseEnergy", 1, 1); CEventDispatcher.GetInstance().AddEventListener(CEventType.ENERGY_ENOUGH, EnergyEnoughEffect); }
public void EndMoveToNext() { ScrollSceneManager.instance.DisableScroll(); enemyGroup.InstUnits(); mineGroup.MoveForward(); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.NEXT_BATTALE_START, this)); }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_WIN, EndSkill); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.MOVE_TO_NEXT, EndSkill); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.ENERGY_EMPTY, EndSkill); EndSkill(); }
public void Win() { mineGroup.Win(); DungeonStoryPlayer.PlayAfterBossDialog(delegate() { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_WIN, this)); }); }
void Start() { bomb = GetComponentInChildren <Bomb>(); mTrans = transform; mTrans.localPosition = from; CEventDispatcher.GetInstance().AddEventListener(CEventType.MOVE_TO_NEXT, OnMoveToNext); ui = GetComponent <UIWidget>(); DragClick.instance.AddListenUI(ui); }
public override void Init() { self = GetComponent <HeroFightUnit>(); /* 自动使用技能,当处于自动战斗或者混乱状态下 */ self.OnNoramlAttackFinish += ThinkUseSkill; /*普通攻击初始化*/ normalAttack = NGUITools.AddChild <NormalAttack>(gameObject); normalAttack.attack = Util.GetDic <MsgAttackData, AttackData>()[normalAttackId]; JsonData castEffectDt = JsonMapper.ToObject(Util.GetConfigString(normalAttack.attack.castEffect)); for (int i = 0; i < castEffectDt.Count; i++) { normalAttack.castEffectIds.Add((int)castEffectDt[i]); } JsonData flyEffectDt = JsonMapper.ToObject(Util.GetConfigString(normalAttack.attack.flyEffect)); for (int i = 0; i < flyEffectDt.Count; i++) { normalAttack.flyEffectIds.Add((int)flyEffectDt[i]); } JsonData hitEffectDt = JsonMapper.ToObject(Util.GetConfigString(normalAttack.attack.hitEffect)); for (int i = 0; i < hitEffectDt.Count; i++) { normalAttack.hitEffectIds.Add((int)hitEffectDt[i]); } normalAttack.mineUnit = self; normalAttack.Init(); /*主动技能初始化*/ normalSkill = NGUITools.AddChild <ActiveSkill>(gameObject); normalSkill.normalSkill = Util.GetDic <MsgNormalSkill, NormalSkill>()[normalSkillId]; int LvUpId = normalSkillId * 100 + normalSkillLv; normalSkill.normalSkillLvUp = Util.GetDic <MsgNormalSkillLvUp, NormalSkillLvUp>()[LvUpId]; normalSkill.dmgEffectId = (int)normalSkill.normalSkill.dmgEffect; normalSkill.castEffectId = (int)normalSkill.normalSkill.castEffect; normalSkill.flyEffectId = (int)normalSkill.normalSkill.flyEffect; normalSkill.hitEffectId = (int)normalSkill.normalSkill.hitEffect; normalSkill.mineUnit = self; normalSkill.Init(); /*绝技初始化*/ specailSkill = NGUITools.AddChild <UniqueSkill>(gameObject); specailSkill.specialSkill = Util.GetDic <MsgSpecialSkill, SpecialSkill>()[specailSkillId]; int specailLvId = specailSkillId * 100 + specailSkillLv; specailSkill.specialSkillLvUp = Util.GetDic <MsgSpecialSkillLvUp, SpecialSkillLvUp>()[specailLvId]; specailSkill.castEffectId = (int)specailSkill.specialSkill.castEffect; specailSkill.dmgEffectId = (int)specailSkill.specialSkill.dmgEffect; specailSkill.flyEffectId = (int)specailSkill.specialSkill.flyEffect; specailSkill.hitEffectId = (int)specailSkill.specialSkill.hitEffect; specailSkill.mineUnit = self; specailSkill.Init(); /*队长技能初始化*/ CEventDispatcher.GetInstance().AddEventListener(CEventType.MOVE_TO_NEXT, ResetAutoState); }
void OnS2C_ResponseFightBegin(BaseEvent evt) { DungeonManager.enemyWave.Clear(); clientmsg.s2c_fightbegin fightbegin = (clientmsg.s2c_fightbegin)evt.Params["protomsg"]; ArrangementPanel.data = fightbegin.enemylist; if (ArrangementPanel.data.Count > 0) { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_DATA, null)); } }
void Awake() { CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_WIN, Evaluate); CEventDispatcher.GetInstance().AddEventListener(CEventType.MOVE_TO_NEXT, UpdateWaveUI); CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_OVER, OnGameOver); instance = this; enabled = false; DungeonRecord.Clear(); StartCoroutine(Init()); }
void OnDestroy() { if (DragClick.hasInstance) { DragClick.instance.RemoveListenUI(ui); } CEventDispatcher.GetInstance().RemoveEventListener(CEventType.MOVE_TO_NEXT, OnMoveToNext); if (!hasFreeBomb) { DungeonRecord.unKillWuya++; } }
private void Update() { if (Input.GetKeyDown(KeyCode.S)) { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.NEXT_BATTALE_START, this)); } if (Input.GetKeyDown(KeyCode.O)) { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_OVER, this)); } if (Input.GetKeyDown(KeyCode.W)) { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_WIN, this)); } }
// Use this for initialization void Start() { if (material != null) { if (DoMatChange(PropertyName)) { Debug.Log("Has"); } } Hashtable hashtable = new Hashtable(); hashtable.Add("神1", "Go1"); hashtable.Add("神2", "Go2"); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_DATA, hashtable, this.gameObject)); }
public void EndMoveToNext() { ScrollSceneManager.instance.DisableScroll(); enemyGroup.InstUnits(); if (enemyGroup.wave == DungeonManager.enemyWave.Count) { DungeonStoryPlayer.PlayPreBossDialog(delegate() { enemyGroup.MoveForward(); mineGroup.MoveForward(); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.NEXT_BATTALE_START, this)); }); } else { enemyGroup.MoveForward(); mineGroup.MoveForward(); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.NEXT_BATTALE_START, this)); } }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.NEXT_BATTALE_START, StartKongxi); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_WIN, StopKongxi); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_OVER, StopKongxi); }
void Start() { CEventDispatcher.GetInstance().AddEventListener(CEventType.NEXT_BATTALE_START, StartKongxi); CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_WIN, StopKongxi); CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_OVER, StopKongxi); }
public override void Init() { CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_WIN, EndSkill); CEventDispatcher.GetInstance().AddEventListener(CEventType.MOVE_TO_NEXT, EndSkill); CEventDispatcher.GetInstance().AddEventListener(CEventType.ENERGY_EMPTY, EndSkill); //魔法动作 string magicDt = Util.GetConfigString(specialSkill.delay); JsonData jd00 = JsonMapper.ToObject(magicDt); if (jd00.Count > 0) { magicDelay = new float[jd00.Count]; for (int i = 0; i < jd00.Count; i++) { magicDelay[i] = float.Parse(jd00[i].ToString()); } } //施法动作 string action01 = Util.GetConfigString(specialSkill.preAction); JsonData jd01 = JsonMapper.ToObject(action01); if (jd01.Count > 0) { preActionName = jd01[0].ToString(); preActionWorkTime = new float[jd01[1].Count]; for (int i = 0; i < jd01[1].Count; i++) { preActionWorkTime[i] = float.Parse(jd01[1][i].ToString()); } } //持续施法动作 string action02 = Util.GetConfigString(specialSkill.skillAction); JsonData jd02 = JsonMapper.ToObject(action02); if (jd02.Count > 0) { actionName = jd02[0].ToString(); actionWorkTime = new float[jd02[1].Count]; for (int i = 0; i < jd02[1].Count; i++) { actionWorkTime[i] = float.Parse(jd02[1][i].ToString()); } } //buff string buffString = Util.GetConfigString(specialSkillLvUp.buff); JsonData dt_1 = JsonMapper.ToObject(buffString); for (int i = 0; i < dt_1.Count; i++) { JsonData dt_2 = dt_1[i]; buffConfig bc = new buffConfig(); bc.id = int.Parse(dt_2[0].ToString()); bc.percent = float.Parse(dt_2[1].ToString()); bc.value = float.Parse(dt_2[2].ToString()); bc.time = float.Parse(dt_2[3].ToString()); bc.level = int.Parse(dt_2[4].ToString()); bc.bindSkill = this; buffConfigList.Add(bc); } //附加效果 attachExtension = (SkillAttach)specialSkillLvUp.addEffect; attachExtensionParam = JsonMapper.ToObject(Util.GetConfigString(specialSkillLvUp.addEffectVal)); base.Init(); }
void Start() { CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_WIN, Evaluate); }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_WIN, Evaluate); }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_WIN, Evaluate); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.MOVE_TO_NEXT, UpdateWaveUI); CEventDispatcher.GetInstance().RemoveEventListener(CEventType.GAME_OVER, OnGameOver); }
// Start is called before the first frame update void Start() { CEventDispatcher.GetInstance().AddEventListener("开始触发", MyTestFunc); CEventDispatcher.GetInstance().DispatchStringEvent(new CBaseEvent("开始触发", "这是重要数值123")); }
public void MoveToNext() { StartCoroutine(StartMoveToNext()); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.MOVE_TO_NEXT, this)); }
// Use this for initialization void Start() { Util.CloseDialog(DialogType.Duplicate); // AWConnection.awnetgate.AddEventListener(AWEvent.S2C_INTOEMBATTLE, OnIntoemBattle); CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_DATA, LoadEnemyGroup); }
public void Win() { mineGroup.Win(); CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_WIN, this)); }
public void GameOver() { CEventDispatcher.GetInstance().DispatchEvent(new CBaseEvent(CEventType.GAME_OVER, this)); }
private void Awake() { CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_DATA, MyTestFun); CEventDispatcher.GetInstance().AddEventListener(CEventType.GAME_OVER, MyTestFun); }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.ENERGY_ENOUGH, EnergyEnoughEffect); }
void OnDestroy() { CEventDispatcher.GetInstance().RemoveEventListener(CEventType.MOVE_TO_NEXT, ResetAutoState); }