Merge branch 'game' of http://127.0.0.1:3000/fatiao/ro-webgl into game
This commit is contained in:
commit
0da59f4fe0
@ -121,28 +121,28 @@ public class FighterManager
|
|||||||
if (TeamFighters.Count == 0)
|
if (TeamFighters.Count == 0)
|
||||||
return Vector3.forward;
|
return Vector3.forward;
|
||||||
return TeamFighters[0].Ctrl != null ? TeamFighters[0].Ctrl.transform.forward : TeamFighters[0].Forward;
|
return TeamFighters[0].Ctrl != null ? TeamFighters[0].Ctrl.transform.forward : TeamFighters[0].Forward;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public FighterManager (BaseBattle battle)
|
public FighterManager(BaseBattle battle)
|
||||||
{
|
{
|
||||||
mBattle = battle;
|
mBattle = battle;
|
||||||
IsDisposed = false;
|
IsDisposed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FighterManager()
|
FighterManager()
|
||||||
{
|
{
|
||||||
HasInitializedFighters = false;
|
HasInitializedFighters = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPveMark()
|
public void SetPveMark()
|
||||||
{
|
{
|
||||||
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
Fighter f = mAllFighters[idx];
|
Fighter f = mAllFighters[idx];
|
||||||
if(f.IsTeamMember)
|
if (f.IsTeamMember)
|
||||||
{
|
{
|
||||||
f.AddPveMark();
|
f.AddPveMark();
|
||||||
}
|
}
|
||||||
@ -150,105 +150,31 @@ public class FighterManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void InitializeCurrentSceneFighters ()
|
public void InitializeCurrentSceneFighters()
|
||||||
{
|
|
||||||
if (mBattle == null || HasInitializedFighters)
|
|
||||||
return;
|
|
||||||
|
|
||||||
List<ActorData> fighterInfos = mBattle.MyFighters;
|
|
||||||
for (int i = 0; i < fighterInfos.Count; i++) {
|
|
||||||
AddFighter(fighterInfos[i], eTeamType.Friend);
|
|
||||||
}
|
|
||||||
|
|
||||||
fighterInfos = mBattle.EnemyFighters;
|
|
||||||
for (int i = 0; i < fighterInfos.Count; i++) {
|
|
||||||
AddFighter(fighterInfos[i], eTeamType.Enemy);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//初始化召唤物
|
|
||||||
for(int idx =0; idx < mAllFighters.Count;idx++)
|
|
||||||
{
|
|
||||||
Fighter f = mAllFighters[idx];
|
|
||||||
if (f.Skills == null || f.Skills.Length == 0) continue;
|
|
||||||
|
|
||||||
if (f.RageCloneBossId > 0)
|
|
||||||
{
|
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100,idx), f.RageCloneBossId, 1);
|
|
||||||
ad.PositionValue = f.PositionValue;
|
|
||||||
|
|
||||||
f.RageCloneBoss = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
|
||||||
mAllFighters.Add(f.RageCloneBoss);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int jdx =0; jdx < f.Skills.Length;jdx++)
|
|
||||||
{
|
|
||||||
BaseSkill skill = f.Skills[jdx];
|
|
||||||
if(skill != null && skill.IsValid && (skill.SummonActors!=null || skill.SummonBosses!=null))
|
|
||||||
{
|
|
||||||
if(skill.SummonActors!=null)
|
|
||||||
{
|
|
||||||
for (int i =0; i < skill.SummonActors.Count;i++)
|
|
||||||
{
|
|
||||||
ValType sa = skill.SummonActors[i];
|
|
||||||
|
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
|
||||||
ad.PositionValue = sa.val;
|
|
||||||
|
|
||||||
Fighter summon = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
|
||||||
mAllFighters.Add(summon);
|
|
||||||
skill.AddSummonActor(summon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(skill.SummonBosses!=null)
|
|
||||||
{
|
|
||||||
for(int i =0; i < skill.SummonBosses.Count;i++)
|
|
||||||
{
|
|
||||||
ValType sa = skill.SummonActors[i];
|
|
||||||
|
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
|
||||||
ad.PositionValue = sa.val;
|
|
||||||
|
|
||||||
Fighter summon = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
|
||||||
mAllFighters.Add(summon);
|
|
||||||
skill.AddSummonActor(summon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HasInitializedFighters = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InitFighters()
|
|
||||||
{
|
{
|
||||||
if (mBattle == null || HasInitializedFighters)
|
if (mBattle == null || HasInitializedFighters)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(mBattle.TeamActors!=null)
|
List<ActorData> fighterInfos = mBattle.MyFighters;
|
||||||
|
for (int i = 0; i < fighterInfos.Count; i++)
|
||||||
{
|
{
|
||||||
for (int idx = 0; idx < mBattle.TeamActors.Count;idx++)
|
AddFighter(fighterInfos[i], eTeamType.Friend);
|
||||||
{
|
|
||||||
AddFighter(mBattle.TeamActors[idx], eTeamType.Friend);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mBattle.EnemyActors!=null)
|
fighterInfos = mBattle.EnemyFighters;
|
||||||
|
for (int i = 0; i < fighterInfos.Count; i++)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mBattle.EnemyActors.Count;idx++)
|
AddFighter(fighterInfos[i], eTeamType.Enemy);
|
||||||
{
|
|
||||||
AddFighter(mBattle.EnemyActors[idx], eTeamType.Enemy);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//初始化召唤物
|
//初始化召唤物
|
||||||
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
Fighter f = mAllFighters[idx];
|
Fighter f = mAllFighters[idx];
|
||||||
if (f.Skills == null || f.Skills.Length == 0) continue;
|
if (f.Skills == null || f.Skills.Length == 0) continue;
|
||||||
|
|
||||||
if(f.RageCloneBossId > 0)
|
if (f.RageCloneBossId > 0)
|
||||||
{
|
{
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), f.RageCloneBossId, 1);
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), f.RageCloneBossId, 1);
|
||||||
ad.PositionValue = f.PositionValue;
|
ad.PositionValue = f.PositionValue;
|
||||||
@ -264,7 +190,83 @@ public class FighterManager
|
|||||||
{
|
{
|
||||||
if (skill.SummonActors != null)
|
if (skill.SummonActors != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < skill.SummonActors.Count;i++)
|
for (int i = 0; i < skill.SummonActors.Count; i++)
|
||||||
|
{
|
||||||
|
ValType sa = skill.SummonActors[i];
|
||||||
|
|
||||||
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
||||||
|
ad.PositionValue = sa.val;
|
||||||
|
|
||||||
|
Fighter summon = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
||||||
|
mAllFighters.Add(summon);
|
||||||
|
skill.AddSummonActor(summon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (skill.SummonBosses != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < skill.SummonBosses.Count; i++)
|
||||||
|
{
|
||||||
|
ValType sa = skill.SummonActors[i];
|
||||||
|
|
||||||
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
||||||
|
ad.PositionValue = sa.val;
|
||||||
|
|
||||||
|
Fighter summon = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
||||||
|
mAllFighters.Add(summon);
|
||||||
|
skill.AddSummonActor(summon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HasInitializedFighters = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitFighters()
|
||||||
|
{
|
||||||
|
if (mBattle == null || HasInitializedFighters)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mBattle.TeamActors != null)
|
||||||
|
{
|
||||||
|
for (int idx = 0; idx < mBattle.TeamActors.Count; idx++)
|
||||||
|
{
|
||||||
|
AddFighter(mBattle.TeamActors[idx], eTeamType.Friend);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mBattle.EnemyActors != null)
|
||||||
|
{
|
||||||
|
for (int idx = 0; idx < mBattle.EnemyActors.Count; idx++)
|
||||||
|
{
|
||||||
|
AddFighter(mBattle.EnemyActors[idx], eTeamType.Enemy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化召唤物
|
||||||
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
|
{
|
||||||
|
Fighter f = mAllFighters[idx];
|
||||||
|
if (f.Skills == null || f.Skills.Length == 0) continue;
|
||||||
|
|
||||||
|
if (f.RageCloneBossId > 0)
|
||||||
|
{
|
||||||
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), f.RageCloneBossId, 1);
|
||||||
|
ad.PositionValue = f.PositionValue;
|
||||||
|
|
||||||
|
f.RageCloneBoss = Fighter.CreateFighter(this, ad, f.TeamSide, f);
|
||||||
|
mAllFighters.Add(f.RageCloneBoss);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int jdx = 0; jdx < f.Skills.Length; jdx++)
|
||||||
|
{
|
||||||
|
BaseSkill skill = f.Skills[jdx];
|
||||||
|
if (skill != null && skill.IsValid && (skill.SummonActors != null || skill.SummonBosses != null))
|
||||||
|
{
|
||||||
|
if (skill.SummonActors != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < skill.SummonActors.Count; i++)
|
||||||
{
|
{
|
||||||
ValType sa = skill.SummonActors[i];
|
ValType sa = skill.SummonActors[i];
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
||||||
@ -278,7 +280,7 @@ public class FighterManager
|
|||||||
|
|
||||||
if (skill.SummonBosses != null)
|
if (skill.SummonBosses != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < skill.SummonBosses.Count;i++)
|
for (int i = 0; i < skill.SummonBosses.Count; i++)
|
||||||
{
|
{
|
||||||
ValType sa = skill.SummonBosses[i];
|
ValType sa = skill.SummonBosses[i];
|
||||||
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
ActorData ad = ActorData.CreateNpcPlayerActor(CommonUtil.CalcSummonNpcUniqueId(100, idx), sa.id, 1);
|
||||||
@ -298,24 +300,24 @@ public class FighterManager
|
|||||||
|
|
||||||
public void ParseLoad()
|
public void ParseLoad()
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mAllFighters.Count;idx++)
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
Fighter fighter = mAllFighters[idx];
|
Fighter fighter = mAllFighters[idx];
|
||||||
fighter.Ctrl.ParseLoad();
|
fighter.Ctrl.ParseLoad();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Fighter AddFighter (ActorData actor, eTeamType side)
|
public Fighter AddFighter(ActorData actor, eTeamType side)
|
||||||
{
|
{
|
||||||
Fighter fighter = GetFighterByID(actor.ID,side);
|
Fighter fighter = GetFighterByID(actor.ID, side);
|
||||||
if (fighter != null) return fighter;
|
if (fighter != null) return fighter;
|
||||||
|
|
||||||
|
|
||||||
fighter = Fighter.CreateFighter (this, actor,side);
|
fighter = Fighter.CreateFighter(this, actor, side);
|
||||||
if(fighter.IsTeamMember)
|
if (fighter.IsTeamMember)
|
||||||
{
|
{
|
||||||
mTeamFigters.Add(fighter);
|
mTeamFigters.Add(fighter);
|
||||||
if(fighter.IsPet)
|
if (fighter.IsPet)
|
||||||
{
|
{
|
||||||
mTeamPetFighters.Add(fighter);
|
mTeamPetFighters.Add(fighter);
|
||||||
}
|
}
|
||||||
@ -328,15 +330,16 @@ public class FighterManager
|
|||||||
{
|
{
|
||||||
mEnemyFighters.Add(fighter);
|
mEnemyFighters.Add(fighter);
|
||||||
}
|
}
|
||||||
mAllFighters.Add (fighter);
|
mAllFighters.Add(fighter);
|
||||||
|
|
||||||
return fighter;
|
return fighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddFighters (ActorData[] actors, eTeamType side)
|
public void AddFighters(ActorData[] actors, eTeamType side)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < actors.Length; i++) {
|
for (int i = 0; i < actors.Length; i++)
|
||||||
AddFighter (actors [i], side);
|
{
|
||||||
|
AddFighter(actors[i], side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +352,7 @@ public class FighterManager
|
|||||||
{
|
{
|
||||||
mCacheTeamFighters.Clear();
|
mCacheTeamFighters.Clear();
|
||||||
mCacheTeamFighters.AddRange(mTeamFigters);
|
mCacheTeamFighters.AddRange(mTeamFigters);
|
||||||
for(int idx =0; idx < mCacheTeamFighters.Count;idx++)
|
for (int idx = 0; idx < mCacheTeamFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
RemoveFighter(mCacheTeamFighters[idx]);
|
RemoveFighter(mCacheTeamFighters[idx]);
|
||||||
}
|
}
|
||||||
@ -357,14 +360,14 @@ public class FighterManager
|
|||||||
|
|
||||||
public void RestoreTeamFighters()
|
public void RestoreTeamFighters()
|
||||||
{
|
{
|
||||||
for(int idx = mTeamFigters.Count-1;idx>=0;idx--)
|
for (int idx = mTeamFigters.Count - 1; idx >= 0; idx--)
|
||||||
{
|
{
|
||||||
Fighter f = mTeamFigters[idx];
|
Fighter f = mTeamFigters[idx];
|
||||||
RemoveFighter(f);
|
RemoveFighter(f);
|
||||||
f.Destroy();
|
f.Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int idx =0; idx < mCacheTeamFighters.Count;idx++)
|
for (int idx = 0; idx < mCacheTeamFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
AddTeamFighter(mCacheTeamFighters[idx]);
|
AddTeamFighter(mCacheTeamFighters[idx]);
|
||||||
}
|
}
|
||||||
@ -373,36 +376,37 @@ public class FighterManager
|
|||||||
|
|
||||||
private void AddTeamFighter(Fighter f)
|
private void AddTeamFighter(Fighter f)
|
||||||
{
|
{
|
||||||
if(!mTeamFigters.Contains(f))
|
if (!mTeamFigters.Contains(f))
|
||||||
mTeamFigters.Add(f);
|
mTeamFigters.Add(f);
|
||||||
|
|
||||||
if(!mAllFighters.Contains(f))
|
if (!mAllFighters.Contains(f))
|
||||||
mAllFighters.Add(f);
|
mAllFighters.Add(f);
|
||||||
|
|
||||||
if(f.IsPet)
|
if (f.IsPet)
|
||||||
{
|
{
|
||||||
if(!mTeamPetFighters.Contains(f))
|
if (!mTeamPetFighters.Contains(f))
|
||||||
mTeamPetFighters.Add(f);
|
mTeamPetFighters.Add(f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!mTeamHeroFighters.Contains(f))
|
if (!mTeamHeroFighters.Contains(f))
|
||||||
mTeamHeroFighters.Add(f);
|
mTeamHeroFighters.Add(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FixedUpdate (float deltaTime)
|
public void FixedUpdate(float deltaTime)
|
||||||
{
|
{
|
||||||
#if PROFILE
|
#if PROFILE
|
||||||
UnityEngine.Profiling.Profiler.BeginSample("FighterManager FixedUpdate1111");
|
UnityEngine.Profiling.Profiler.BeginSample("FighterManager FixedUpdate1111");
|
||||||
#endif
|
#endif
|
||||||
for (int i = 0; i < mBattleFieldFighters.Count; i++)
|
for (int i = 0; i < mBattleFieldFighters.Count; i++)
|
||||||
{
|
{
|
||||||
Fighter fighter = mBattleFieldFighters[i];
|
Fighter fighter = mBattleFieldFighters[i];
|
||||||
if (fighter.IsSpawned && !fighter.IsDisposed && !fighter.IsDisposed) {
|
if (fighter.IsSpawned && !fighter.IsDisposed && !fighter.IsDisposed)
|
||||||
fighter.FixedUpdate (deltaTime);
|
{
|
||||||
}
|
fighter.FixedUpdate(deltaTime);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#if PROFILE
|
#if PROFILE
|
||||||
UnityEngine.Profiling.Profiler.EndSample();
|
UnityEngine.Profiling.Profiler.EndSample();
|
||||||
#endif
|
#endif
|
||||||
@ -429,7 +433,7 @@ public class FighterManager
|
|||||||
UnityEngine.Profiling.Profiler.EndSample();
|
UnityEngine.Profiling.Profiler.EndSample();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
public void FixedUpdateByEditor(float deltaTime)
|
public void FixedUpdateByEditor(float deltaTime)
|
||||||
@ -457,89 +461,103 @@ public class FighterManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
public void Dispose ()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
if (IsDisposed)
|
if (IsDisposed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mAllFighters.Count; i++)
|
for (int i = 0; i < mAllFighters.Count; i++)
|
||||||
{
|
{
|
||||||
var fighter = mAllFighters[i];
|
var fighter = mAllFighters[i];
|
||||||
if (fighter != null)
|
if (fighter != null)
|
||||||
{
|
{
|
||||||
fighter.Destroy();
|
fighter.Destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveAllFighters();
|
RemoveAllFighters();
|
||||||
|
|
||||||
LeftCaptain = null;
|
LeftCaptain = null;
|
||||||
RightCaptain = null;
|
RightCaptain = null;
|
||||||
|
|
||||||
HasInitializedFighters = false;
|
HasInitializedFighters = false;
|
||||||
|
|
||||||
mBattle = null;
|
mBattle = null;
|
||||||
}
|
}
|
||||||
catch (System.Exception e) {
|
catch (System.Exception e)
|
||||||
DebugHelper.Log ("error: {0}: {1}", e.Message, e.StackTrace);
|
{
|
||||||
}
|
DebugHelper.Log("error: {0}: {1}", e.Message, e.StackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
IsDisposed = true;
|
IsDisposed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFighterSpawned (Fighter fighter)
|
public void OnFighterSpawned(Fighter fighter)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFighterDie (Fighter fighter)
|
public void OnFighterDie(Fighter fighter)
|
||||||
{
|
{
|
||||||
Debug.Log("tzy_角色死亡_1");
|
Debug.Log("tzy_角色死亡_1");
|
||||||
if (mBattle.IsNormalBattle) Debug.Log("tzy_角色死亡_2 " + fighter);
|
if (mBattle.IsNormalBattle) Debug.Log("tzy_角色死亡_2 " + fighter);
|
||||||
if (mBattle.IsNormalBattle && fighter.IsNpc) Debug.Log("tzy_角色死亡_3 ");
|
if (mBattle.IsNormalBattle && fighter.IsNpc) Debug.Log("tzy_角色死亡_3 ");
|
||||||
if (mBattle.IsNormalBattle && fighter.IsNpc)
|
if (mBattle.IsNormalBattle && fighter.IsNpc)
|
||||||
{
|
{
|
||||||
Vector3 startpos,goldpos, emptypos;
|
Vector3 startpos, goldpos, emptypos;
|
||||||
startpos = fighter.Position;
|
|
||||||
|
startpos = fighter.Ctrl.GetUIPointPos();
|
||||||
|
startpos += fighter.Actor.AvatarData.bloodBarPos;
|
||||||
|
startpos = Camera.main.WorldToViewportPoint(startpos);
|
||||||
|
Vector3 startpos2 = new Vector3(
|
||||||
|
(startpos.x - 0.5f) * UIMgr.SCREEN_WIDTH,
|
||||||
|
(startpos.y - 0.5f) * UIMgr.SCREEN_HEIGHT,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
Debug.Log("tzy_ " + startpos2);
|
||||||
|
|
||||||
goldpos = new Vector3(421, -241, 0);
|
goldpos = new Vector3(421, -241, 0);
|
||||||
emptypos = new Vector3(0, 0, 0);
|
emptypos = new Vector3(0, 0, 0);
|
||||||
BattleDropMgr.Instance.GenerateDropItems(startpos, true, goldpos, false, emptypos, false, emptypos, false, emptypos
|
BattleDropMgr.Instance.GenerateDropItems(startpos2, true, goldpos, false, emptypos, false, emptypos, false, emptypos
|
||||||
,null, 0.05f, 0.25f);
|
, null, 0.05f, 0.25f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFighterRelive (Fighter fighter)
|
public void OnFighterRelive(Fighter fighter)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Fighter> GetUnSpawnedFighters (int wave)
|
public List<Fighter> GetUnSpawnedFighters(int wave)
|
||||||
{
|
{
|
||||||
return mAllFighters.FindAll (a => !a.IsSpawned && a.TeamSide == eTeamType.Enemy);
|
return mAllFighters.FindAll(a => !a.IsSpawned && a.TeamSide == eTeamType.Enemy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Fighter> GetAllLeftSortedFighters ()
|
public List<Fighter> GetAllLeftSortedFighters()
|
||||||
{
|
{
|
||||||
List<Fighter> result = mAllFighters.FindAll (a => a.TeamSide == eTeamType.Friend);
|
List<Fighter> result = mAllFighters.FindAll(a => a.TeamSide == eTeamType.Friend);
|
||||||
CommonUtil.SortList(result, (lhs, rhs) => rhs.PositionValue - lhs.PositionValue);
|
CommonUtil.SortList(result, (lhs, rhs) => rhs.PositionValue - lhs.PositionValue);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Fighter GetFighterByID (long id, eTeamType teamid, int idx = 0)
|
public Fighter GetFighterByID(long id, eTeamType teamid, int idx = 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mAllFighters.Count; i++) {
|
for (int i = 0; i < mAllFighters.Count; i++)
|
||||||
if (mAllFighters [i].TeamSide == teamid && mAllFighters [i].Id == id) {
|
{
|
||||||
return mAllFighters [i];
|
if (mAllFighters[i].TeamSide == teamid && mAllFighters[i].Id == id)
|
||||||
}
|
{
|
||||||
}
|
return mAllFighters[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Fighter GetFighterByBaseId(int baseId, eTeamType teamId)
|
public Fighter GetFighterByBaseId(int baseId, eTeamType teamId)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mAllFighters.Count;idx++)
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
if(mAllFighters[idx].TeamSide == teamId && mAllFighters[idx].Actor.BaseId == baseId)
|
if (mAllFighters[idx].TeamSide == teamId && mAllFighters[idx].Actor.BaseId == baseId)
|
||||||
{
|
{
|
||||||
return mAllFighters[idx];
|
return mAllFighters[idx];
|
||||||
}
|
}
|
||||||
@ -547,18 +565,19 @@ public class FighterManager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Fighter GetFighterByInstanceID (ulong instanceid)
|
public Fighter GetFighterByInstanceID(ulong instanceid)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mAllFighters.Count; i++) {
|
for (int i = 0; i < mAllFighters.Count; i++)
|
||||||
if (mAllFighters [i].InstanceId == instanceid)
|
{
|
||||||
return mAllFighters [i];
|
if (mAllFighters[i].InstanceId == instanceid)
|
||||||
}
|
return mAllFighters[i];
|
||||||
return null;
|
}
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public Fighter GetTeamMemberById(long id)
|
public Fighter GetTeamMemberById(long id)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mTeamFigters.Count;idx++)
|
for (int idx = 0; idx < mTeamFigters.Count; idx++)
|
||||||
{
|
{
|
||||||
if (mTeamFigters[idx].Id == id)
|
if (mTeamFigters[idx].Id == id)
|
||||||
return mTeamFigters[idx];
|
return mTeamFigters[idx];
|
||||||
@ -568,10 +587,10 @@ public class FighterManager
|
|||||||
|
|
||||||
public Fighter GetNpcByBaseId(int baseId)
|
public Fighter GetNpcByBaseId(int baseId)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mAllFighters.Count; idx++)
|
for (int idx = 0; idx < mAllFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
Fighter fighter = mAllFighters[idx];
|
Fighter fighter = mAllFighters[idx];
|
||||||
if(fighter.Actor.IsNpc && fighter.Actor.BaseId == baseId)
|
if (fighter.Actor.IsNpc && fighter.Actor.BaseId == baseId)
|
||||||
{
|
{
|
||||||
return fighter;
|
return fighter;
|
||||||
}
|
}
|
||||||
@ -613,7 +632,7 @@ public class FighterManager
|
|||||||
|
|
||||||
public bool HasTeamHero(long id)
|
public bool HasTeamHero(long id)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mTeamHeroFighters.Count;idx++)
|
for (int idx = 0; idx < mTeamHeroFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
if (mTeamHeroFighters[idx].Id == id) return true;
|
if (mTeamHeroFighters[idx].Id == id) return true;
|
||||||
}
|
}
|
||||||
@ -623,7 +642,7 @@ public class FighterManager
|
|||||||
|
|
||||||
public bool HasPet(long id)
|
public bool HasPet(long id)
|
||||||
{
|
{
|
||||||
for(int idx =0; idx < mTeamPetFighters.Count;idx++)
|
for (int idx = 0; idx < mTeamPetFighters.Count; idx++)
|
||||||
{
|
{
|
||||||
if (mTeamPetFighters[idx].Id == id) return true;
|
if (mTeamPetFighters[idx].Id == id) return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user