/// <summary> /// 创建怪物 /// </summary> private void CreateMonterObject() { MonsterTemplate _monsterData = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(GlobalMembers.SPELL_SHOW_MONTER_ID); ArtresourceTemplate _atrRes = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(_monsterData.getArtresources()); GameObject _assetRes = AssetLoader.Inst.GetAssetRes(_atrRes.getArtresources()); if (_assetRes != null) { GameObject _go = Instantiate(_assetRes, m_BossPos.position, m_BossPos.rotation) as GameObject; SceneObjectManager.GetInstance().SceneObjectAddMonster(_go, 1, 0); //_go.transform.rotation = Quaternion.Euler(_go.transform.rotation.x, 180, _go.transform.rotation.z); _go.transform.localScale = new Vector3(3, 3, 3); Animation _anim = _go.GetComponent <Animation>(); if (_anim == null) { return; } if (_go.GetComponent <Animation>()["Idle1"] != null) { _go.GetComponent <Animation>().CrossFade("Idle1"); } else if (_go.GetComponent <Animation>()["Nidle1"] != null) { _go.GetComponent <Animation>().CrossFade("Nidle1"); } _go.GetComponent <Animation>().wrapMode = WrapMode.Loop; } }
private void SelectFireSigh() { if (m_CurTouchState == TouchState.SelectSkillTarget_state) { return; } if (Input.GetMouseButtonDown(0)) { // TODO... GUIDE Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { GameObject obj = hit.transform.gameObject; if (obj) { ObjectCreature objC = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(obj); if (objC != null && objC.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER && objC.IsAlive()) { SceneObjectManager.GetInstance().UpdateFireSignCreature(objC); } } } } }
private bool CheckCondition19(int[] Param) { m_TempSkillTag.Clear(); if (m_ReleaseObj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO) { int count = SceneObjectManager.GetInstance().GetObjectMonsterCount(); for (int i = 0; i < count; ++i) { for (int j = 0; j < Param.Length; ++j) { if (SceneObjectManager.GetInstance().GetSceneMonsterList()[i].GetMonsterRow().getId() == Param[j]) { m_TempSkillTag.Add(SceneObjectManager.GetInstance().GetSceneMonsterList()[i]); } } } } else if (m_ReleaseObj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER) { int count = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < count; ++i) { for (int j = 0; j < Param.Length; ++j) { if (SceneObjectManager.GetInstance().GetSceneHeroList()[i].GetHeroRow().getId() == Param[j]) { m_TempSkillTag.Add(SceneObjectManager.GetInstance().GetSceneHeroList()[i]); } } } } return(m_TempSkillTag.Count > 0); }
/* * This method communicates with the DD_PolyAR.cs script to query 3d models from Google's poly api */ // public static void ChangeSearch(string plataform = "poly") // { // searchOnPoly = string.Compare(plataform, "poly") == 0; // } public void Awake() { poly_api.getInitialAssets(searchOnPoly); Debug.Log(this.name); parent = GameObject.FindWithTag("asset_panels"); container = parent.GetComponent <RectTransform>(); arPlaneManager = FindObjectOfType <ARPlaneManager>(); // get panel asset size from prefab panelSize = new Vector2(assets_panel_prefab.GetComponent <RectTransform>().sizeDelta.x, assets_panel_prefab.GetComponent <RectTransform>().sizeDelta.y); Debug.Log("Panel Size " + panelSize.ToString()); // Add listener to search button search_button.onClick.AddListener(SearchButtonQuery); search_google_button.gameObject.SetActive(false); info_button.gameObject.SetActive(false); disable_button.gameObject.SetActive(false); poly_api.onAssetImported.AddListener(SetFeaturedArtistText); poly_api.onAssetImported.AddListener(ShowButtons); objectManager = FindObjectOfType <SceneObjectManager>(); objectManager.onObjectRemoved.AddListener(HideButtons); objectManager.onObjectSelected.AddListener(SetFeaturedArtistText); //delete_button.onClick.AddListener(delegate { objectManager.RemoveObjectFromScene(SceneObjectManager.currObj); } ); if (ar_toggle_image != null) { vr_toggle_button.image.sprite = ar_toggle_image; vr_toggle_button.onClick.AddListener(ToggleVRImage); } }
private bool CheckCondition23(int[] Param) { if (m_ReleaseObj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO) { int count = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < count; ++i) { for (int j = 0; j < Param.Length; ++j) { if (SceneObjectManager.GetInstance().GetSceneHeroList()[i].GetHeroRow().getId() == Param[j]) { // m_TempSkillTag = SceneObjectManager.GetInstance().GetSceneHeroList()[i]; return(false); } } } } else { int count = SceneObjectManager.GetInstance().GetObjectMonsterCount(); for (int i = 0; i < count; ++i) { for (int j = 0; j < Param.Length; ++j) { if (SceneObjectManager.GetInstance().GetSceneMonsterList()[i].GetMonsterRow().getId() == Param[j]) { // m_TempSkillTag = SceneObjectManager.GetInstance().GetSceneMonsterList()[i]; return(false); } } } } return(true); }
/// <summary> /// 创建英雄 /// </summary> private void CreateHeroObject() { GameObject _heroObject = AssetLoader.Inst.GetAssetRes(m_ArtResData.getArtresources()); if (_heroObject != null) { Transform _pos = null; if (m_AttackType == 0) { _pos = m_HeroNearPos; } else { _pos = m_HeroFarPos; } GameObject _obj = Instantiate(_heroObject, _pos.position, _pos.rotation) as GameObject; _obj.transform.localScale = new Vector3(2, 2, 2); Animation _anim = _obj.GetComponent <Animation>(); if (_anim == null) { return; } if (_obj.GetComponent <Animation>()["Idle1"] != null) { _obj.GetComponent <Animation>().CrossFade("Idle1"); } else if (_obj.GetComponent <Animation>()["Nidle1"] != null) { _obj.GetComponent <Animation>().CrossFade("Nidle1"); } _obj.GetComponent <Animation>().wrapMode = WrapMode.Loop; SceneObjectManager.GetInstance().SceneObjectAddHero(_obj, m_HeroTableId, m_Card); } }
public void SendRoundOver() { CEndlessPass packet = new CEndlessPass(); List <FightInfo> _InfoList = SceneObjectManager.GetInstance().GetFightInfoList(); for (int i = 0; i < _InfoList.Count; i++) { bool isAdd = false; if (i + 30 > _InfoList.Count || i % 10 == 0) { isAdd = true; } else { isAdd = IsAdd(_InfoList[i]); } if (!isAdd) { continue; } GNET.fightInfo _info = new GNET.fightInfo(); GameUtils.CopyFightInfo(ref _info, _InfoList[i]); packet.fightinfolist.AddLast(_info); } IOControler.GetInstance().SendProtocol(packet); }
private void OnMouseDrag() { if (!SceneObjectManager.IsPointerOverUIObject()) { Debug.Log("Mouse Drag " + SceneObjectManager.currObj.name); // if current object is not same as touched object if (SceneObjectManager.currObj != GetRootGameObject(this.transform.gameObject)) { Debug.Log("Dragging object " + this.transform.parent.name); // set current gameObject to dragged object objectManager.SetSelectedObject(GetRootGameObject(this.transform.gameObject)); } if (SceneObjectManager.currObj == null) { objectManager.SetSelectedObject(GetRootGameObject(this.transform.gameObject)); } if (SceneObjectManager.touchPoseIsValid && SceneObjectManager.currObj != null) { SceneObjectManager.currObj.transform.position = SceneObjectManager.touchPos; SceneObjectManager.currObj.transform.LookAt(Camera.main.transform); SceneObjectManager.currObj.transform.eulerAngles = new Vector3(0, this.transform.eulerAngles.y + 180f, 0); } } }
/// <summary> /// 每击杀一波敌人后,我方奖励怒气 [3/3/2015 Zmy] /// </summary> private void EachRewardPower() { // 奖励怒气 = 主角等级影响 + 英雄等级影响 + 装备符文等其他能增加英雄属性系统影响 + config中配置的全局变量 + 地图奖励 [3/3/2015 Zmy] //int nSelf_value = ObjectSelf.GetInstance().GetWavaPowerValue(); int nHero_value = 0; for (int i = 0; i < SceneObjectManager.GetInstance().GetObjectHeroCount(); i++) { ObjectHero pHero = SceneObjectManager.GetInstance().GetHeroObject(i); if (pHero == null || pHero.IsAlive() == false) { continue; } // int nCurLevel = pHero.GetHeroData().Level; // int nInitFuryTemplateID = pHero.GetHeroRow().getWaveFury() - 1; // // HerofuryTemplate pRow = (HerofuryTemplate)DataTemplate.GetInstance().m_HeroFuryTable.getTableData(nCurLevel); // if (nInitFuryTemplateID >= 0 && nInitFuryTemplateID < GlobalMembers.MAX_HEROFURY_PARAM_COUNT) // { // nHero_value += pRow.getTemplate()[nInitFuryTemplateID]; // } AngertableTemplate _data = (AngertableTemplate)DataTemplate.GetInstance().m_AngerTable.getTableData(pHero.GetHeroRow().getFuryId()); nHero_value += _data.getWaveFury(); } //int nGlobalWavaFury = DataTemplate.GetInstance().m_GameConfig.getWave_fury(); //int nSum = nSelf_value + nHero_value + nGlobalWavaFury; m_HeroPower.OnUpdatePowerValue(nHero_value); }
//当前战斗结束 [1/21/2015 Zmy] private void OnRoundOver() { //每回合结束 清空敌方的怒气值 [3/3/2015 Zmy] m_EnemyPower.OnUpdatePowerValue(-m_EnemyPower.GetPowerValue()); //击杀一波怪物后,对本方怒气进行奖励刷新 [3/3/2015 Zmy] EachRewardPower(); GameEventDispatcher.Inst.dispatchEvent(GameEventID.F_BattleRoundOver); if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter) { ObjectSelf.GetInstance().LimitFightMgr.SendRoundOver(); } else { //胜利条件 if (m_RoundInScene == FightEditorContrler.GetInstantiate().GetMonsterGroupCount()) { SetFightState(FightState.FightWin); } else { FightEditorContrler.GetInstantiate().CamPause(); SetFightState(FightState.HeroMove); } } //每回合结束 清空战斗数据。 [6/26/2015 Zmy] SceneObjectManager.GetInstance().UpdateRoundOver(); }
//英雄瞬间移动结束慢慢出现 private void UpdateMomentMoveExit() { int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < nHeroCount; ++i) { ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i); if (HeroObj != null && HeroObj.IsAlive()) { //..慢慢出现 m_ShowCount++; } } if (m_ShowCount == SceneObjectManager.GetInstance().GetObjectHeroCount()) { m_ShowCount = 0; FightEditorContrler.GetInstantiate().HeroPathNormalMove(); SetFightState(FightState.HeroMove); for (int i = 0; i < nHeroCount; ++i) { ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i); if (HeroObj != null && HeroObj.IsAlive()) { HeroObj.GetNavMesh().enabled = true; HeroObj.SetObjectActionState(ObjectCreature.ObjectActionState.forward); } } } }
//######################################################技能攻击动作接口############################################### //飞行技能攻击回调 // 创建技能弹道特效 [3/4/2015 Zmy] private void SkillAttack_Fly(string nCurHit) { if (nCurHit.Contains(".0")) { string _tmp = nCurHit.Substring(0, nCurHit.LastIndexOf(".0")); if (_tmp.Equals("-1") || string.IsNullOrEmpty(_tmp)) { SceneObjectManager.GetInstance().SkillAttack_CallBack(gameObject, m_OwnerType, 1, 1); } else { SceneObjectManager.GetInstance().SkillAttack_CallBack(gameObject, m_OwnerType, 1, int.Parse(_tmp)); } } else { if (nCurHit.Equals("-1") || string.IsNullOrEmpty(nCurHit)) { SceneObjectManager.GetInstance().SkillAttack_CallBack(gameObject, m_OwnerType, 1, 1); } else { try { SceneObjectManager.GetInstance().SkillAttack_CallBack(gameObject, m_OwnerType, 1, int.Parse(nCurHit)); } catch (System.Exception ex) { LogManager.LogError("!!!Error: SkillAttack_Fly() param Parse is error!! the GameObject is:" + gameObject + "====param is :" + nCurHit); } } } }
private void OnSceneFightLose() { int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < nHeroCount; ++i) { ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i); if (HeroObj != null && HeroObj.IsAlive()) { NavMeshAgent Nav = HeroObj.GetNavMesh(); Nav.SetDestination(HeroObj.GetGameObject().transform.position); HeroObj.GetAnimation().Anim_Fidle(false); } } if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter) { ObjectSelf.GetInstance().LimitFightMgr.SendRoundOver(); } else { if (ObjectSelf.GetInstance().WorldBossMgr.m_bStartEnter) { ObjectSelf.GetInstance().WorldBossMgr.SendRoundOver(); } else { CEndBattle battle = new CEndBattle(); battle.pass = 0;// 未通过 IOControler.GetInstance().SendProtocol(battle); } } GameTimeControler.Inst.SetState(TimeScaleState.TimeScale_Normal); }
public override void InitUIView() { base.InitUIView(); m_BossText.text = "It's only a Accident"; m_DamageText.text = GameUtils.getString("legend_of_the_war_content6"); m_DamagePointText.text = SceneObjectManager.GetInstance().WorldBossDamageSum.ToString(); m_AwardText.text = GameUtils.getString("legend_of_the_war_content7"); if (m_FightState == FightState.FightWin) { m_KillText.gameObject.SetActive(true); if (m_BossPassDataPack.m_Result == BossPassDataPack.END_KILLBOSS) { m_KillText.text = GameUtils.getString("legend_of_the_war_content3"); } else if (m_BossPassDataPack.m_Result == BossPassDataPack.END_ISKILL) { m_KillText.text = string.Format(GameUtils.getString("legend_of_the_war_content4"), m_BossPassDataPack.m_BossKillName); } } else { m_KillText.gameObject.SetActive(false); } LoadAwardItem(); }
bool IsFrontRowDie() { bool firstDie = SceneObjectManager.GetInstance().IsMonsterDie(CurrentFightCount, 0); bool secDie = SceneObjectManager.GetInstance().IsMonsterDie(CurrentFightCount, 1); return(firstDie && secDie); }
protected override void UpdateState() { if (GetOwnerType() == 1) { ObjectHero obj = (ObjectHero)SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject); if (obj != null) { CurState = obj.GetActionState(); if (obj.GetCurLockTarget() != null) { CurLockTarget = obj.GetCurLockTarget().GetGameObject(); } if (obj.GetSkillLockTarget() != null) { CurLockSkillTarget = obj.GetSkillLockTarget().GetGameObject(); } } } else { ObjectMonster obj = (ObjectMonster)SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject); if (obj != null) { CurState = obj.GetActionState(); } } if (m_EventData != null && _anim[lastAnimatimName] != null) { m_EventData.OnUpdateEvent(_event, _anim[lastAnimatimName]); } }
//实例化Hero对象 private void CallBack_InitHeroObject() { for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; ++i) { int nGroup = ObjectSelf.GetInstance().Teams.GetDefaultGroup(); if (nGroup < 0 && nGroup >= GlobalMembers.MAX_MATRIX_COUNT) { continue; } X_GUID pMemberGuiD = null; if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter) { pMemberGuiD = ObjectSelf.GetInstance().LimitFightMgr.m_HeroInfo[i]; if (ObjectSelf.GetInstance().LimitFightMgr.m_HeroHp[i] == 0) { //初始英雄时,如果血量记录是0 代表本次是继续开启的试炼。并且上次的英雄已死亡。那么本次不再实例化英雄 [6/19/2015 Zmy] pMemberGuiD.CleanUp(); } } else { pMemberGuiD = ObjectSelf.GetInstance().Teams.m_Matrix[nGroup, i]; //暂时默认上场第一组阵型的英雄[3/25/2015 Zmy] } if (!pMemberGuiD.IsValid()) { continue; } ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(pMemberGuiD); if (pHero == null) { continue; } ArtresourceTemplate _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(pHero.GetHeroData().GetHeroViewID()); if (_Artresourcedata == null) { continue; } GameObject pHeroObject = AssetLoader.Inst.GetAssetRes(_Artresourcedata.getArtresources()); if (pHeroObject != null) { GameObject obj1 = Instantiate(pHeroObject, FightEditorContrler.GetInstantiate().GetFormationCenterPos(i), FightEditorContrler.GetInstantiate().GetFormationCenterAngle(i)) as GameObject; GameUtils.SetLayerRecursively(obj1, FightEditorContrler.GetInstantiate().GetShadowCullMaskLayer()); float _zoom = _Artresourcedata.getArtresources_zoom(); obj1.transform.localScale = new UnityEngine.Vector3(_zoom, _zoom, _zoom); SceneObjectManager.GetInstance().SceneObjectAddHero(obj1, pHero.GetHeroRow().getId(), pHero); FightEditorContrler.GetInstantiate().InitFormationPos(pHero, i); } } FightEditorContrler.GetInstantiate().HeroPathInitSpeed(); GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_StoryCameraEnd); //初始化完成后,切换状态 [1/20/2015 Zmy] SetFightState(FightState.prepareData); //初始入场怒气 InitFightPower(); }
private void UpdateHeroBoarding() { moveTime += Time.deltaTime; if (moveTime < 0.1f) { return; } moveTime = 0f; int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < nHeroCount; i++) { ObjectHero HeroObj = SceneObjectManager.GetInstance().GetHeroObject(i); if (HeroObj != null && HeroObj.IsAlive()) { NavMeshAgent Nav = HeroObj.GetNavMesh(); Nav.speed = HeroObj.GetMoveSpeed(); Nav.SetDestination(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj)); //HeroObj.SetWorldPosRotation(FightEditorContrler.GetInstantiate().GetFormationPos(HeroObj), FightEditorContrler.GetInstantiate().GetFormationAngle(HeroObj)); HeroObj.SetObjectActionState(ObjectCreature.ObjectActionState.boarding); HeroObj.GetAnimation().Anim_Fidle(false); } } }
public override void Initialize(SceneObjectManager newManager) { base.Initialize(newManager); sizes = new Vector3[] { new Vector3(sizeRange.x, sizeRange.x, sizeRange.x), new Vector3(sizeRange.y, sizeRange.y, sizeRange.y) }; contactFilter = new ContactFilter2D(); contactFilter.SetLayerMask(LayerMask.GetMask("Buildings", "Asteroids")); contactFilter.ClearDepth(); }
public override void UpdateUIState() { if (SceneObjectManager.GetInstance() != null) { SceneObjectManager.GetInstance().OnUpdateFightingLogic(); } mTouchControl.Update(); }
//======================================================================================================= //添加特效为子物体 private void addEff(string effectName, GameObject Clone, Transform parent) { //Clone = Instantiate(Resources.Load(effectName), parent.position, parent.rotation) as GameObject; //Clone.transform.parent = parent; ObjectCreature pCaster = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject); EffectManager.GetInstance().InstanceEffect_Static(effectName, pCaster, parent, 0f, true); }
protected override void InitView() { base.InitView(); SceneObjectManager.GetInstance().InitSkillShowState(); CreateMonterObject(); CreateHeroObject(); CreateTeamMate(); }
//技能攻击结束回调 private void SkillAttackEnd() { if (ObjectSelf.GetInstance().isSkillShow) { SceneObjectManager.GetInstance().InitSkillShowState(); UI_SkillShow.Inst.GetSkillIconScript().SetIsClick(true); return; } SceneObjectManager.GetInstance().SkillAttack_CallBack(gameObject, m_OwnerType, 4); }
/// <summary> /// 准备上载具的位置修正; /// </summary> /// <param name="obj"></param> /// <param name="heroObj"></param> private void CallBack_PrepareBoardPos(GameObject obj, ObjectHero heroObj) { m_BoardHeroCount++; heroObj.SetObjectActionState(ObjectCreature.ObjectActionState.boarding); if (m_BoardHeroCount >= SceneObjectManager.GetInstance().GetObjectHeroCount()) { m_BoardHeroCount = 0; SetFightState(FightState.PrepareBoardOver); } }
private void OnAItypeUpdate(int type) { int cout = Ok_heros.Count; int Maxtemp = -1; int FinishHerovalue = -1; //最终释放技能英雄的索引 SpellAILogic FinishAi = null; //最终释放技能模板 for (int i = 0; i < cout; ++i) { SpellAILogic temp = ChooseAILogicPriority(Ok_heros[i], type);//获取能释放技能的有效优先级 if (temp != null) { HerosSpellAILogicList.Add(temp); AIOk_heros.Add(Ok_heros[i]); } } int cout2 = HerosSpellAILogicList.Count; for (int i = 0; i < cout2; ++i) { if (HerosSpellAILogicList[i].GetPriority() > Maxtemp) { Maxtemp = HerosSpellAILogicList[i].GetPriority(); FinishAi = HerosSpellAILogicList[i]; FinishHerovalue = i; } } if (FinishHerovalue >= 0) { if (SceneObjectManager.GetInstance().GetIsFireSignState() && SceneObjectManager.GetInstance().GetFireSighCreatrue() != null) { AIOk_heros[FinishHerovalue].SetSkillLockTarget(SceneObjectManager.GetInstance().GetFireSighCreatrue()); } else { AIOk_heros[FinishHerovalue].SetSkillLockTarget(FinishAi.GetSkillTag()); } if (AIOk_heros[FinishHerovalue].OnPre_CheckUseSkillCondtion()) { //AIOk_heros[FinishHerovalue].OnSkillConsume(); //AIOk_heros[FinishHerovalue].SetObjectActionState(ObjectCreature.ObjectActionState.skillAttack); //string name = FinishAi.GetSkillInfo().GetSpellRow().getSkillNameRes(); //SkillShowNamePackage package = new SkillShowNamePackage(AIOk_heros[FinishHerovalue].GetGuid(), name); //GameEventDispatcher.Inst.dispatchEvent(GameEventID.F_ShowSkillName, package); AIOk_heros[FinishHerovalue].LaunchFreeSpellLogic(EM_SPELL_PASSIVE_INDEX.EM_SPELL_PASSIVE_INITIATIVE); } else { AIOk_heros[FinishHerovalue].SetSkillLockTarget(null); } //Debug.Log(AIOk_heros[FinishHerovalue].GetGameObject().name); } }
//瞬间移动进入前位置修正 private void CallBack_MomentMoveEnter(GameObject obj, ObjectHero heroObj) { m_MonmentMoveHeroPosCount++; heroObj.SetObjectActionState(ObjectCreature.ObjectActionState.monmentmoveIng); //heroObj.GetAnimation().Anim_Fidle(false); if (m_MonmentMoveHeroPosCount == SceneObjectManager.GetInstance().GetObjectHeroCount()) { m_MonmentMoveHeroPosCount = 0; SetFightState(FightState.HeroMonmentMoveIng); } }
/// <summary> /// 开场剧情播放进入 /// </summary> private void CallBack_StoryCameraEnter() { SetFightState(FightState.FightStoryCamera); int nHeroCount = SceneObjectManager.GetInstance().GetObjectHeroCount(); for (int i = 0; i < nHeroCount; ++i) { ObjectHero pHero = SceneObjectManager.GetInstance().GetHeroObject(i); pHero.GetAnimation().Anim_Fidle(false); } }
//private IEnumerator delay() //{ // yield return new WaitForSeconds(0.5f); // mMessageTip.gameObject.SetActive(false); //} private void onFightStatuChange() { FightState statu = FightControler.Inst.GetFightState(); switch (statu) { case FightState.prepareData: { // 初始化完成,创建血条 List <ObjectHero> heros = SceneObjectManager.GetInstance().GetSceneHeroList(); for (int i = 0; i < heros.Count; i++) { mBloodControl.CreateBloodBar(heros[i]); //mMenuPanel.CreateSkillIcon(heros[i], heros.Count - ObjectSelf.GetInstance().Teams.GetTeamIndexByHeroGuid(heros[i].GetGuid())); mMenuPanel.CreateSkillIcon(heros[i], i); } //mMenuPanel.SetInitObjectIsShow(true); //mMenuPanel.SkillAutoSort(); } break; case FightState.prepareEnemy_over: { // 初始化敌人的血条 List <ObjectMonster> monsters = SceneObjectManager.GetInstance().GetSceneMonsterList(); foreach (ObjectMonster monster in monsters) { if (monster.IsAlive()) { UI_Blood blood = mBloodControl.CreateBloodBar(monster); blood.gameObject.SetActive(false); } } } break; case FightState.FightStoryCamera: break; case FightState.FightStory: { mBloodControl.HideAllBlood(); } break; case FightState.prepareFight: { mBloodControl.ShowAllBlood(); } break; } }
public void UpdateFidTime() { if (FidLengh <= 0) { FidLengh = 0; ObjectCreature obj = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject); obj.SetObjectActionState(ObjectCreature.ObjectActionState.normalAttack); } else { FidLengh -= Time.deltaTime; } }
public void UpdateSurplusNormalAttackTime() { if (SurplusAttackLength <= 0) { SurplusAttackLength = 0; ObjectCreature obj = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject); obj.SetObjectActionState(ObjectCreature.ObjectActionState.AttackIdle); } else { SurplusAttackLength -= Time.deltaTime; } }