mobs balance
This commit is contained in:
parent
bf33a2a32f
commit
ef33df92b6
@ -541,7 +541,7 @@ PrefabInstance:
|
|||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
|
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
value: 3
|
value: 2
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
|
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
@ -852,63 +852,6 @@ Transform:
|
|||||||
m_CorrespondingSourceObject: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
|
m_CorrespondingSourceObject: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
|
||||||
m_PrefabInstance: {fileID: 1080547517}
|
m_PrefabInstance: {fileID: 1080547517}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
--- !u!1001 &1177075715
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 1869821417}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 2
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: -1.8834
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 0.72714
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: -2.1158
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 6863736067666425520, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: Pistol
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
|
|
||||||
--- !u!1001 &1279967480
|
--- !u!1001 &1279967480
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1089,7 +1032,7 @@ MonoBehaviour:
|
|||||||
overMind: {fileID: 1682053525}
|
overMind: {fileID: 1682053525}
|
||||||
timeOnStart: 30
|
timeOnStart: 30
|
||||||
DeathScreen: {fileID: 732765870}
|
DeathScreen: {fileID: 732765870}
|
||||||
balanceScale: 1.6
|
balanceScale: 1.5
|
||||||
--- !u!1 &1506820044
|
--- !u!1 &1506820044
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1422,16 +1365,9 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: a35c03cf584d904acac0d316af6a31fb, type: 3}
|
m_Script: {fileID: 11500000, guid: a35c03cf584d904acac0d316af6a31fb, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
mob: {fileID: 4086673825482164031, guid: e47d96f25248114df8e596380d90afc6, type: 3}
|
|
||||||
megaMob: {fileID: 0}
|
|
||||||
pullSize: 20
|
pullSize: 20
|
||||||
characterObject: {fileID: 1869821414}
|
characterObject: {fileID: 1869821414}
|
||||||
gamePlay: {fileID: 1483883356}
|
gamePlay: {fileID: 1483883356}
|
||||||
mobMoveSpeed: 0.2
|
|
||||||
mobHealth: 100
|
|
||||||
mobDamage: 10
|
|
||||||
mobAddedTime: 0.5
|
|
||||||
mobPull: {fileID: 0}
|
|
||||||
activeMobs: {fileID: 1560770443}
|
activeMobs: {fileID: 1560770443}
|
||||||
mobs:
|
mobs:
|
||||||
- mobName: standartMob
|
- mobName: standartMob
|
||||||
|
@ -31,7 +31,7 @@ void Update()
|
|||||||
{
|
{
|
||||||
horInpt = Input.GetAxis("Horizontal");
|
horInpt = Input.GetAxis("Horizontal");
|
||||||
verInpt = Input.GetAxis("Vertical");
|
verInpt = Input.GetAxis("Vertical");
|
||||||
if (-0.1f > horInpt || horInpt > 0.1f)
|
if (moveSpeed > horInpt || horInpt > moveSpeed)
|
||||||
{
|
{
|
||||||
characterAnimator.SetBool("IsRun", true);
|
characterAnimator.SetBool("IsRun", true);
|
||||||
transform.position += new Vector3(horInpt * moveSpeed,0,0);
|
transform.position += new Vector3(horInpt * moveSpeed,0,0);
|
||||||
|
@ -35,13 +35,14 @@ private IEnumerator AutoBalance()
|
|||||||
{
|
{
|
||||||
yield return new WaitForSeconds(30f);
|
yield return new WaitForSeconds(30f);
|
||||||
print("autobalance");
|
print("autobalance");
|
||||||
if (balanceScale > 1.1f)
|
if (balanceScale > 1.1f && balanceScale < 1.5f)
|
||||||
{
|
{
|
||||||
balanceScale -= 0.1f;
|
balanceScale -= 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
_characterCharacterClass.SetHealth(_characterCharacterClass.GetHealth() * balanceScale);
|
// _characterCharacterClass.SetHealth(_characterCharacterClass.GetHealth() * balanceScale);
|
||||||
_characterCharacterClass.SetDamage(_characterCharacterClass.GetDamage() * balanceScale);
|
// _characterCharacterClass.SetDamage(_characterCharacterClass.GetDamage() * balanceScale);
|
||||||
|
overMind.GetComponent<OverMind>().SetBalanceScale(balanceScale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,17 +104,17 @@ void OnTriggerEnter2D(Collider2D col)
|
|||||||
IEnumerator waiter()
|
IEnumerator waiter()
|
||||||
{
|
{
|
||||||
yield return new WaitForSecondsRealtime(0.5f);
|
yield return new WaitForSecondsRealtime(0.5f);
|
||||||
//overMind.DeathGoToPull(gameObject, mobAddedTime);
|
overMind.DeathGoToPull(gameObject, mobAddedTime);
|
||||||
Destroy(gameObject);
|
//Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetupMob(OverMind.MobParameters mobParameters)
|
public void SetupMob(OverMind.MobParameters mobParameters, float balanceScale)
|
||||||
{
|
{
|
||||||
moveSpeed = mobParameters.MoveSpeed;
|
moveSpeed = mobParameters.MoveSpeed;
|
||||||
characterObject = mobParameters.Character;
|
characterObject = mobParameters.Character;
|
||||||
overMind = mobParameters.OverMind;
|
overMind = mobParameters.OverMind;
|
||||||
health = mobParameters.Health;
|
health = mobParameters.Health * balanceScale;
|
||||||
damage = mobParameters.Damage;
|
damage = mobParameters.Damage * balanceScale;
|
||||||
mobAddedTime = mobParameters.AddedTime;
|
mobAddedTime = mobParameters.AddedTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,19 +4,14 @@
|
|||||||
|
|
||||||
public class OverMind : MonoBehaviour
|
public class OverMind : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private GameObject mob;
|
|
||||||
[SerializeField] private GameObject megaMob;
|
|
||||||
[SerializeField] private int pullSize;
|
[SerializeField] private int pullSize;
|
||||||
|
|
||||||
[SerializeField] private GameObject characterObject;
|
[SerializeField] private GameObject characterObject;
|
||||||
[SerializeField] private Gameplay gamePlay;
|
[SerializeField] private Gameplay gamePlay;
|
||||||
[SerializeField] private float mobMoveSpeed;
|
|
||||||
[SerializeField] private float mobHealth;
|
// [SerializeField] private GameObject mobPull;
|
||||||
[SerializeField] private float mobDamage;
|
|
||||||
[SerializeField] private float mobAddedTime;
|
|
||||||
|
|
||||||
[SerializeField] private GameObject mobPull;
|
|
||||||
[SerializeField] private GameObject activeMobs;
|
[SerializeField] private GameObject activeMobs;
|
||||||
|
private float balanceScale = 1.5f;
|
||||||
|
|
||||||
private List<GameObject> _pullEnemies;
|
private List<GameObject> _pullEnemies;
|
||||||
|
|
||||||
@ -154,19 +149,26 @@ IEnumerator spawnMobsCourutine()
|
|||||||
var mobToSpawn = mobs[Random.Range(0, mobs.Count-1)];
|
var mobToSpawn = mobs[Random.Range(0, mobs.Count-1)];
|
||||||
var mobToSpawnObject = Instantiate(mobToSpawn.mobPrefab ,activeMobs.transform);
|
var mobToSpawnObject = Instantiate(mobToSpawn.mobPrefab ,activeMobs.transform);
|
||||||
mobToSpawnObject.transform.position = GenerateRandomSpawnMobPoint();
|
mobToSpawnObject.transform.position = GenerateRandomSpawnMobPoint();
|
||||||
mobToSpawnObject.GetComponent<Mob>().SetupMob(mobToSpawn);
|
mobToSpawnObject.GetComponent<Mob>().SetupMob(mobToSpawn, balanceScale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeathGoToPull(GameObject mob, float addedTime)
|
public void DeathGoToPull(GameObject mob, float addedTime)
|
||||||
{
|
{
|
||||||
gamePlay.SendMessage("AddTime", addedTime);
|
gamePlay.SendMessage("AddTime", addedTime);
|
||||||
mob.SetActive(false);
|
Destroy(mob);
|
||||||
mob.transform.parent = mobPull.transform;
|
//mob.SetActive(false);
|
||||||
|
//mob.transform.parent = mobPull.transform;
|
||||||
}
|
}
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetBalanceScale(float newBalanceScale)
|
||||||
|
{
|
||||||
|
print(newBalanceScale);
|
||||||
|
balanceScale = newBalanceScale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user