添加湖南株洲万达神农城潮玩社场景
This commit is contained in:
@@ -120,6 +120,8 @@ public class Boss : Enemy
|
||||
endValue = 0.51f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Ningxia_Yinchuan_Jinfeng_XinhualianGuangchang)
|
||||
endValue = 15.75f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
endValue = 1.28f;
|
||||
if(GameInit.Ins.gamePlace == GamePlace.Shandong_Jining_Shangchang)
|
||||
{
|
||||
transform.DOMove(new Vector3(11.5f,transform.position.y,3.68f), 4).OnComplete(() =>
|
||||
@@ -422,6 +424,13 @@ public class Boss : Enemy
|
||||
Both();
|
||||
});
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
transform.DOMove(new Vector3(2.18f, 3f, 1.28f), 4).OnComplete(() =>
|
||||
{
|
||||
Both();
|
||||
});
|
||||
}
|
||||
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Company1FloorShiwai)
|
||||
{
|
||||
|
||||
@@ -200,6 +200,8 @@ public class DropShip : Enemy
|
||||
endValue = -5.7f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Gansu_Jinchang_Jinchuan_Shijiguangchang_Shiwai)
|
||||
endValue = 1.47f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
endValue = 1.53f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Company1Floor)
|
||||
{
|
||||
transform.DOMove(new Vector3(7f, transform.position.y, 12f), 4).OnComplete(() =>
|
||||
@@ -641,6 +643,21 @@ public class DropShip : Enemy
|
||||
_isShow = false;
|
||||
});
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
transform.DOMove(new Vector3(11.26f, 5f, 1.53f), 4).OnComplete(() =>
|
||||
{
|
||||
isAttack = true;
|
||||
foreach (var item in tailGas)
|
||||
{
|
||||
item.SetActive(true);
|
||||
}
|
||||
bloodSlider.gameObject.SetActive(true);
|
||||
isShield = false;
|
||||
shieldObj.SetActive(false);
|
||||
_isShow = false;
|
||||
});
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Company1FloorShiwai)
|
||||
{
|
||||
transform.DOMove(new Vector3(1.59f, 5f, 20.24f), 4).OnComplete(() =>
|
||||
|
||||
@@ -411,6 +411,13 @@ public class Leviathan : Enemy
|
||||
Both();
|
||||
});
|
||||
}
|
||||
else if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
transform.DOMove(new Vector3(0.4f, -3.5f, 8.7f), 2).OnComplete(() =>
|
||||
{
|
||||
Both();
|
||||
});
|
||||
}
|
||||
else if (GameInit.Ins.gamePlace == GamePlace.Company1FloorShiwai)
|
||||
{
|
||||
transform.DOMove(new Vector3(-10.91f, 1.5f, 25.15f), 2).OnComplete(() =>
|
||||
|
||||
@@ -396,6 +396,13 @@ public class MachineDragon : Enemy
|
||||
Both();
|
||||
});
|
||||
}
|
||||
else if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
transform.DOMove(new Vector3(4.93f, 0f,0.89f), 4).OnComplete(() =>
|
||||
{
|
||||
Both();
|
||||
});
|
||||
}
|
||||
else if (GameInit.Ins.gamePlace == GamePlace.Company1FloorShiwai)
|
||||
{
|
||||
transform.DOMove(new Vector3(-4.48f, 0f, 21.35f), 4).OnComplete(() =>
|
||||
|
||||
@@ -80,6 +80,7 @@ public enum GamePlace
|
||||
Chengdu_Shuangliu_ShengfeiXuexiao =43,
|
||||
Hebei_Hengshui_Xinji_WandaGuangchang = 44,
|
||||
Ningxia_Yinchuan_Jinfeng_XinhualianGuangchang = 45,
|
||||
Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe=46,
|
||||
}
|
||||
|
||||
public class GameManager : MonoBehaviour
|
||||
@@ -644,6 +645,10 @@ public class GameManager : MonoBehaviour
|
||||
{
|
||||
EnergyPump.transform.position = new Vector3(10.35f, 0, 4.33f);
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
EnergyPump.transform.position = new Vector3(-0.09f, 0, 1.37f);
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Company1FloorShiwai)
|
||||
{
|
||||
EnergyPump.transform.position = new Vector3(-0.75f, 0, 22.38f);
|
||||
@@ -711,6 +716,11 @@ public class GameManager : MonoBehaviour
|
||||
{
|
||||
GameObject atkBuff = Instantiate(AtkBuffPre);
|
||||
atkBuff.transform.position = new Vector3(pos.x, 0, pos.z);
|
||||
// 山东廊坊青州泰华城场地的特殊逻辑:道具自动飞向(0,0,0)点
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
StartCoroutine(FlyToCenterPoint(atkBuff, new Vector3(0.1f, 1, 1.68f), 2.0f));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -721,6 +731,10 @@ public class GameManager : MonoBehaviour
|
||||
{
|
||||
GameObject deeBuff = Instantiate(deffBuffPre);
|
||||
deeBuff.transform.position = new Vector3(pos.x, 0, pos.z);
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
StartCoroutine(FlyToCenterPoint(deeBuff, new Vector3(0.1f, 1, 1.68f), 2.0f));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -730,6 +744,11 @@ public class GameManager : MonoBehaviour
|
||||
{
|
||||
GameObject bloodBag = Instantiate(BloodBagPre);
|
||||
bloodBag.transform.position = new Vector3(pos.x, 0, pos.z);
|
||||
// 山东廊坊青州泰华城场地的特殊逻辑:道具自动飞向(0,0,0)点
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
StartCoroutine(FlyToCenterPoint(bloodBag, new Vector3(0.1f, 1, 1.68f), 2.0f));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -740,8 +759,86 @@ public class GameManager : MonoBehaviour
|
||||
GameObject prop = Instantiate(weaponItemPre);
|
||||
prop.GetComponent<WeaponProp>().Init(type);
|
||||
prop.transform.position = new Vector3(pos.x, 1f, pos.z);
|
||||
// 山东廊坊青州泰华城场地的特殊逻辑:道具自动飞向(0,0,0)点
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hunan_Zhuzhou_Wanda_Shennongcheng_Chaowanshe)
|
||||
{
|
||||
StartCoroutine(FlyToCenterPoint(prop, new Vector3(0.1f,1,1.68f), 2.0f));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 道具飞向中心点(0,0,0)的协程
|
||||
/// </summary>
|
||||
/// <param name="prop">道具对象</param>
|
||||
/// <param name="targetPosition">目标位置</param>
|
||||
/// <param name="duration">飞行时间</param>
|
||||
/// <returns></returns>
|
||||
private IEnumerator FlyToCenterPoint(GameObject prop, Vector3 targetPosition, float duration)
|
||||
{
|
||||
if(prop == null) yield break;
|
||||
|
||||
// 获取道具的碰撞器组件,暂时禁用碰撞器避免飞行过程中被拾取
|
||||
Collider propCollider = prop.GetComponent<Collider>();
|
||||
if (propCollider != null)
|
||||
{
|
||||
propCollider.enabled = false;
|
||||
}
|
||||
|
||||
Vector3 startPosition = prop.transform.position;
|
||||
float elapsedTime = 0f;
|
||||
|
||||
// 添加一个向上的弧度,让飞行路径更自然
|
||||
Vector3 controlPoint = (startPosition + targetPosition) * 0.5f + Vector3.up * 2f;
|
||||
|
||||
// 飞行过程中只更新位置,不改变旋转
|
||||
while (elapsedTime < duration && prop != null)
|
||||
{
|
||||
elapsedTime += Time.deltaTime;
|
||||
float t = elapsedTime / duration;
|
||||
|
||||
// 使用二次贝塞尔曲线计算位置
|
||||
Vector3 position = CalculateBezierPoint(startPosition, controlPoint, targetPosition, t);
|
||||
|
||||
// 只更新位置,不改变旋转,让WeaponProp脚本的旋转动画自然运行
|
||||
prop.transform.position = position;
|
||||
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 飞行完成后重新启用碰撞器
|
||||
if (prop != null && propCollider != null)
|
||||
{
|
||||
propCollider.enabled = true;
|
||||
|
||||
// 确保最终位置准确
|
||||
prop.transform.position = targetPosition;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算二次贝塞尔曲线上的点
|
||||
/// </summary>
|
||||
/// <param name="p0">起点</param>
|
||||
/// <param name="p1">控制点</param>
|
||||
/// <param name="p2">终点</param>
|
||||
/// <param name="t">插值参数(0-1)</param>
|
||||
/// <returns>曲线上的点</returns>
|
||||
private Vector3 CalculateBezierPoint(Vector3 p0, Vector3 p1, Vector3 p2, float t)
|
||||
{
|
||||
float u = 1 - t;
|
||||
float tt = t * t;
|
||||
float uu = u * u;
|
||||
|
||||
Vector3 p = uu * p0; // (1-t)^2 * P0
|
||||
p += 2 * u * t * p1; // 2(1-t)t * P1
|
||||
p += tt * p2; // t^2 * P2
|
||||
|
||||
return p;
|
||||
}
|
||||
public bool isFirstGetWeapon;
|
||||
public void EnemyDisGetWeapon(Vector3 pos)
|
||||
{
|
||||
@@ -757,12 +854,22 @@ public class GameManager : MonoBehaviour
|
||||
id = Random.Range(5, 8);
|
||||
if (index is > 50)
|
||||
id = Random.Range(2, 5);
|
||||
CreatePlayerWeapon((PlayerWeaponType)id, pos);
|
||||
if (!isFirstGetWeapon)
|
||||
|
||||
// 对于山东廊坊青州泰华城场地,掉落的位置改为(0,0,0)附近
|
||||
Vector3 dropPosition = pos;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Henan_Xinxiang_Wandaguangchang_Shinei)
|
||||
{
|
||||
GameInit.Ins.PlayAudio("1.5", GameInit.Ins.self.transform, true);
|
||||
isFirstGetWeapon = true;
|
||||
// 在(0,0,0)点周围随机位置掉落
|
||||
dropPosition = new Vector3(
|
||||
Random.Range(1.5f, 2.5f),
|
||||
1f,
|
||||
Random.Range(1.5f, 2.5f)
|
||||
);
|
||||
}
|
||||
|
||||
CreatePlayerWeapon((PlayerWeaponType)id, dropPosition);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void CurEnemyDie()
|
||||
|
||||
@@ -104,7 +104,7 @@ public class LoginPanel : MonoBehaviour
|
||||
_progress = 0;
|
||||
_isLogin = false;
|
||||
|
||||
//GameManager.Ins.InitData();
|
||||
// GameManager.Ins.InitData();
|
||||
//_isLogin = true;//修改为本地游戏
|
||||
float curWaitTime = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user