mobs feautures

This commit is contained in:
dart 2022-04-02 23:49:54 +03:00
parent a8c77b6efa
commit d40bdce3be
4 changed files with 171 additions and 175 deletions

View File

@ -286,56 +286,12 @@ MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4520856288189812233, guid: d58051113365413fe9782fa6b28125fc, type: 3}
m_PrefabInstance: {fileID: 1279967480}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 1869821414}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9ab5d980c53f9d7dc8d828fd5382febe, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &351079944
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 351079946}
- component: {fileID: 351079945}
m_Layer: 0
m_Name: Grid
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!156049354 &351079945
Grid:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 351079944}
m_Enabled: 1
m_CellSize: {x: 1, y: 1, z: 0}
m_CellGap: {x: 0, y: 0, z: 0}
m_CellLayout: 0
m_CellSwizzle: 0
--- !u!4 &351079946
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 351079944}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 763548449}
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
@ -468,68 +424,36 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &763548448
PrefabInstance:
--- !u!1 &679042026
GameObject:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 351079946}
m_Modifications:
- target: {fileID: 772746139284061349, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_Name
value: Tilemap
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
--- !u!4 &763548449 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
m_PrefabInstance: {fileID: 763548448}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 679042027}
m_Layer: 0
m_Name: MobPull
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &679042027
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 679042026}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1682053527}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1061288647
GameObject:
m_ObjectHideFlags: 0
@ -647,7 +571,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1137981222306597008, guid: d58051113365413fe9782fa6b28125fc, type: 3}
propertyPath: m_LocalPosition.y
value: 4.57
value: 0.49
objectReference: {fileID: 0}
- target: {fileID: 1137981222306597008, guid: d58051113365413fe9782fa6b28125fc, type: 3}
propertyPath: m_LocalPosition.z
@ -693,81 +617,50 @@ PrefabInstance:
propertyPath: moveSpeed
value: 0.02
objectReference: {fileID: 0}
- target: {fileID: 8006084803627600395, guid: d58051113365413fe9782fa6b28125fc, type: 3}
propertyPath: m_LocalPosition.x
value: 0.34
objectReference: {fileID: 0}
- target: {fileID: 8006084803627600395, guid: d58051113365413fe9782fa6b28125fc, type: 3}
propertyPath: m_LocalPosition.y
value: 0.28
objectReference: {fileID: 0}
- target: {fileID: 8275013663521780488, guid: d58051113365413fe9782fa6b28125fc, type: 3}
propertyPath: m_Name
value: character
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d58051113365413fe9782fa6b28125fc, type: 3}
--- !u!1001 &1578683490
PrefabInstance:
--- !u!1 &1560770443
GameObject:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4086673825482164031, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_Name
value: mob
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalPosition.x
value: -2.7
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalPosition.y
value: 5.76
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5020074052172004519, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6002007055176810599, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: maxDist
value: 100
objectReference: {fileID: 0}
- target: {fileID: 6002007055176810599, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: minDist
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6002007055176810599, guid: e47d96f25248114df8e596380d90afc6, type: 3}
propertyPath: moveSpeed
value: 0.2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e47d96f25248114df8e596380d90afc6, type: 3}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1560770444}
m_Layer: 0
m_Name: ActiveMobs
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1560770444
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1560770443}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1682053527}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1586286652
GameObject:
m_ObjectHideFlags: 0
@ -886,6 +779,58 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1682053525
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1682053527}
- component: {fileID: 1682053526}
m_Layer: 0
m_Name: OverMind
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1682053526
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1682053525}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a35c03cf584d904acac0d316af6a31fb, type: 3}
m_Name:
m_EditorClassIdentifier:
mob: {fileID: 4086673825482164031, guid: e47d96f25248114df8e596380d90afc6, type: 3}
megaMob: {fileID: 0}
pullSize: 20
characterObject: {fileID: 1869821414}
mobMoveSpeed: 0.2
mobPull: {fileID: 679042026}
activeMobs: {fileID: 1560770443}
--- !u!4 &1682053527
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1682053525}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.7954899, y: 0.8086801, z: -0.67029}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 679042027}
- {fileID: 1560770444}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1786254377
GameObject:
m_ObjectHideFlags: 0
@ -1031,3 +976,8 @@ RectTransform:
m_AnchoredPosition: {x: -0.000015258789, y: 0}
m_SizeDelta: {x: 232.88, y: 21.9572}
m_Pivot: {x: 0, y: 1}
--- !u!1 &1869821414 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 8275013663521780488, guid: d58051113365413fe9782fa6b28125fc, type: 3}
m_PrefabInstance: {fileID: 1279967480}
m_PrefabAsset: {fileID: 0}

View File

@ -47,4 +47,9 @@ public StatReturn GetStats()
};
return stats;
}
public void ApplyDamage(float newDamage)
{
damage += newDamage;
}
}

View File

@ -29,5 +29,6 @@ void Update()
characterHealthText.text = "health = " + characterStats.Health;
characterDamageText.text = "damage = " + characterStats.Damage;
}
}

View File

@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@ -27,7 +28,34 @@ void Update()
{
//transform.position += transform.forward * moveSpeed * Time.deltaTime;
transform.position += (characterObject.transform.position-transform.position) * moveSpeed * Time.deltaTime;
var rawCharacterVector = characterObject.transform.position - transform.position;
var characterVector = new Vector3(
Mathf.Clamp(rawCharacterVector.x, -moveSpeed, moveSpeed),
Mathf.Clamp(rawCharacterVector.y, -moveSpeed, moveSpeed),
0);
if (characterVector.x < 1f && characterVector.x > 0)
{
characterVector.x = 1f;
}
if (characterVector.y < 1f && characterVector.y > 0)
{
characterVector.y = 1f;
}
if (characterVector.x > 1f && characterVector.x < 0)
{
characterVector.x = 1f;
}
if (characterVector.y > -1f && characterVector.y < 0)
{
characterVector.y = 1f;
}
//print(characterVector);
transform.position += (characterObject.transform.position-transform.position) * (moveSpeed * Time.deltaTime);
@ -38,4 +66,16 @@ void Update()
}
}
}
private void OnTriggerEnter2D(Collider2D col)
{
print("Detect");
gameObject.SetActive(false);
}
public void SetupMob(OverMind.MobParameters mobParameters)
{
characterObject = mobParameters.Character;
moveSpeed = mobParameters.MoveSpeed;
}
}