일꾼 일단 완료
This commit is contained in:
parent
58f9abba58
commit
6916b936e3
|
|
@ -166,7 +166,7 @@ public static class MyEditorUtil
|
||||||
var longd = go.GetComponent<NoSeeLongDMob>();
|
var longd = go.GetComponent<NoSeeLongDMob>();
|
||||||
if (longd == null) go.AddComponent<NoSeeLongDMob>();
|
if (longd == null) go.AddComponent<NoSeeLongDMob>();
|
||||||
|
|
||||||
CommonSetting(go, 51);
|
CommonSetting(go, ObstacleAvoidanceType.LowQualityObstacleAvoidance, 51, "Actor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ public static class MyEditorUtil
|
||||||
if (ma == null) ma = go.AddComponent<PetActor>();
|
if (ma == null) ma = go.AddComponent<PetActor>();
|
||||||
ma.m_Role = eRole.Pet;
|
ma.m_Role = eRole.Pet;
|
||||||
|
|
||||||
CommonSetting(go, 51);
|
CommonSetting(go, ObstacleAvoidanceType.LowQualityObstacleAvoidance, 51, "Actor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[MenuItem("Edit/PCSetting", false, -1003)]
|
[MenuItem("Edit/PCSetting", false, -1003)]
|
||||||
|
|
@ -216,7 +216,7 @@ public static class MyEditorUtil
|
||||||
navmesh.avoidancePriority = 50;
|
navmesh.avoidancePriority = 50;
|
||||||
navmesh.obstacleAvoidanceType = ObstacleAvoidanceType.LowQualityObstacleAvoidance;
|
navmesh.obstacleAvoidanceType = ObstacleAvoidanceType.LowQualityObstacleAvoidance;
|
||||||
|
|
||||||
Set_CommonRigidBody(prefabAsset);
|
Set_CommonRigidBody(prefabAsset, "Actor");
|
||||||
|
|
||||||
var cc = prefabAsset.GetComponent<CapsuleCollider>();
|
var cc = prefabAsset.GetComponent<CapsuleCollider>();
|
||||||
if (cc == null) cc = prefabAsset.AddComponent<CapsuleCollider>();
|
if (cc == null) cc = prefabAsset.AddComponent<CapsuleCollider>();
|
||||||
|
|
@ -327,7 +327,7 @@ public static class MyEditorUtil
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CommonSetting(GameObject go, int avoidancePriority)
|
static void CommonSetting(GameObject go, ObstacleAvoidanceType avoid, int avoidancePriority, string layer)
|
||||||
{
|
{
|
||||||
Set_Collideer(go);
|
Set_Collideer(go);
|
||||||
|
|
||||||
|
|
@ -340,13 +340,13 @@ public static class MyEditorUtil
|
||||||
navmesh.autoBraking = true;
|
navmesh.autoBraking = true;
|
||||||
navmesh.radius = 0.25f;
|
navmesh.radius = 0.25f;
|
||||||
navmesh.avoidancePriority = avoidancePriority;
|
navmesh.avoidancePriority = avoidancePriority;
|
||||||
navmesh.obstacleAvoidanceType = ObstacleAvoidanceType.LowQualityObstacleAvoidance;
|
navmesh.obstacleAvoidanceType = avoid;
|
||||||
|
|
||||||
Set_CommonRigidBody(go);
|
Set_CommonRigidBody(go, layer);
|
||||||
}
|
}
|
||||||
static void Set_CommonRigidBody(GameObject go)
|
static void Set_CommonRigidBody(GameObject go, string layer)
|
||||||
{
|
{
|
||||||
go.layer = LayerMask.NameToLayer("Actor");
|
go.layer = LayerMask.NameToLayer(layer);
|
||||||
var rigidbody = go.GetComponent<Rigidbody>();
|
var rigidbody = go.GetComponent<Rigidbody>();
|
||||||
if (rigidbody == null) rigidbody = go.AddComponent<Rigidbody>();
|
if (rigidbody == null) rigidbody = go.AddComponent<Rigidbody>();
|
||||||
rigidbody.useGravity = false;
|
rigidbody.useGravity = false;
|
||||||
|
|
@ -406,17 +406,7 @@ public static class MyEditorUtil
|
||||||
var wa = go.GetComponent<WorkerActor>();
|
var wa = go.GetComponent<WorkerActor>();
|
||||||
if (wa == null) wa = go.AddComponent<WorkerActor>();
|
if (wa == null) wa = go.AddComponent<WorkerActor>();
|
||||||
|
|
||||||
var navmesh = go.GetComponent<NavMeshAgent>();
|
CommonSetting(go, ObstacleAvoidanceType.NoObstacleAvoidance, 0, "Default");
|
||||||
if (navmesh == null) navmesh = go.AddComponent<NavMeshAgent>();
|
|
||||||
|
|
||||||
// NavMeshAgent 설정
|
|
||||||
navmesh.angularSpeed = 120f;
|
|
||||||
navmesh.acceleration = 1000f;
|
|
||||||
navmesh.radius = 0.1f;
|
|
||||||
navmesh.height = 1f;
|
|
||||||
navmesh.obstacleAvoidanceType = ObstacleAvoidanceType.NoObstacleAvoidance;
|
|
||||||
|
|
||||||
Set_Collideer(go);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73500,7 +73500,6 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 55d2c951f510f3241994bf8cdd83e312, type: 3}
|
m_Script: {fileID: 11500000, guid: 55d2c951f510f3241994bf8cdd83e312, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
go_Camera: {fileID: 0}
|
|
||||||
--- !u!1 &6260398950048915527
|
--- !u!1 &6260398950048915527
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -76802,7 +76801,7 @@ PrefabInstance:
|
||||||
- target: {fileID: 960630095900046633, guid: 73c6a05b987c3214f9d0c6ae8a803da6,
|
- target: {fileID: 960630095900046633, guid: 73c6a05b987c3214f9d0c6ae8a803da6,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: 113
|
value: 58.4
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 960630095900046633, guid: 73c6a05b987c3214f9d0c6ae8a803da6,
|
- target: {fileID: 960630095900046633, guid: 73c6a05b987c3214f9d0c6ae8a803da6,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ GameObject:
|
||||||
- component: {fileID: 3840684917986916439}
|
- component: {fileID: 3840684917986916439}
|
||||||
- component: {fileID: 5254117875007108769}
|
- component: {fileID: 5254117875007108769}
|
||||||
- component: {fileID: 8691887067622214584}
|
- component: {fileID: 8691887067622214584}
|
||||||
- component: {fileID: 2169718913078083463}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Coin
|
m_Name: Coin
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -156,25 +155,3 @@ MeshRenderer:
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
--- !u!64 &2169718913078083463
|
|
||||||
MeshCollider:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 8770474071504360176}
|
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IncludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_ExcludeLayers:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 0
|
|
||||||
m_LayerOverridePriority: 0
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_ProvidesContacts: 0
|
|
||||||
m_Enabled: 1
|
|
||||||
serializedVersion: 5
|
|
||||||
m_Convex: 0
|
|
||||||
m_CookingOptions: 30
|
|
||||||
m_Mesh: {fileID: -127844609115117539, guid: f48a1b3e05cf7d94f9ec9b272c050643, type: 3}
|
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ GameObject:
|
||||||
- component: {fileID: 6377084992631546431}
|
- component: {fileID: 6377084992631546431}
|
||||||
- component: {fileID: 2897636524652675864}
|
- component: {fileID: 2897636524652675864}
|
||||||
- component: {fileID: -9032171624714911403}
|
- component: {fileID: -9032171624714911403}
|
||||||
|
- component: {fileID: 6444794995727187772}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Goblin_Baby
|
m_Name: Goblin_Baby
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -219,12 +220,12 @@ NavMeshAgent:
|
||||||
m_GameObject: {fileID: 1946639791678223188}
|
m_GameObject: {fileID: 1946639791678223188}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_AgentTypeID: 0
|
m_AgentTypeID: 0
|
||||||
m_Radius: 0.1
|
m_Radius: 0.25
|
||||||
m_Speed: 3.5
|
m_Speed: 4.5
|
||||||
m_Acceleration: 1000
|
m_Acceleration: 140
|
||||||
avoidancePriority: 50
|
avoidancePriority: 0
|
||||||
m_AngularSpeed: 120
|
m_AngularSpeed: 300
|
||||||
m_StoppingDistance: 0
|
m_StoppingDistance: 0.1
|
||||||
m_AutoTraverseOffMeshLink: 1
|
m_AutoTraverseOffMeshLink: 1
|
||||||
m_AutoBraking: 1
|
m_AutoBraking: 1
|
||||||
m_AutoRepath: 1
|
m_AutoRepath: 1
|
||||||
|
|
@ -253,6 +254,33 @@ BoxCollider:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_Size: {x: 0.85087365, y: 1.4576797, z: 0.48206693}
|
m_Size: {x: 0.85087365, y: 1.4576797, z: 0.48206693}
|
||||||
m_Center: {x: -0.00000008940697, y: 0.22931978, z: 0.011348151}
|
m_Center: {x: -0.00000008940697, y: 0.22931978, z: 0.011348151}
|
||||||
|
--- !u!54 &6444794995727187772
|
||||||
|
Rigidbody:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1946639791678223188}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Mass: 1
|
||||||
|
m_Drag: 0
|
||||||
|
m_AngularDrag: 0.05
|
||||||
|
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||||
|
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||||
|
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_IncludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ExcludeLayers:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 0
|
||||||
|
m_ImplicitCom: 1
|
||||||
|
m_ImplicitTensor: 1
|
||||||
|
m_UseGravity: 0
|
||||||
|
m_IsKinematic: 0
|
||||||
|
m_Interpolate: 0
|
||||||
|
m_Constraints: 126
|
||||||
|
m_CollisionDetection: 0
|
||||||
--- !u!1 &2288852919550759396
|
--- !u!1 &2288852919550759396
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -620,20 +620,19 @@ public class Actor : MyCoroutine
|
||||||
break;
|
break;
|
||||||
case eRole.PC:
|
case eRole.PC:
|
||||||
//InGameInfo.Ins.Defeat_byMonster();
|
//InGameInfo.Ins.Defeat_byMonster();
|
||||||
|
// PC 부활
|
||||||
|
On_Regen();
|
||||||
|
if (!IsEnemy())
|
||||||
|
{
|
||||||
// 소환수 이동
|
// 소환수 이동
|
||||||
var summ = ActorInfo.Ins.Get_Actor(eRole.Summon);
|
var summ = ActorInfo.Ins.Get_Actor(eRole.Summon);
|
||||||
if (!DSUtil.CheckNull(summ)) summ.On_Regen();
|
if (!DSUtil.CheckNull(summ)) summ.On_Regen();
|
||||||
// 펫 부활
|
// 펫 부활
|
||||||
var pet = ActorInfo.Ins.Get_Actor(eRole.Pet);
|
if (!DSUtil.CheckNull(m_MyPet)) m_MyPet.On_Regen();
|
||||||
if (!DSUtil.CheckNull(pet)) pet.On_Regen();
|
|
||||||
// 일꾼 이동
|
// 일꾼 이동
|
||||||
if (!IsEnemy())
|
|
||||||
{
|
|
||||||
var worker = ActorInfo.Ins.Get_Actor(eRole.Worker);
|
var worker = ActorInfo.Ins.Get_Actor(eRole.Worker);
|
||||||
if (!DSUtil.CheckNull(worker)) worker.On_Regen();
|
if (!DSUtil.CheckNull(worker)) worker.On_Regen();
|
||||||
}
|
}
|
||||||
// PC 부활
|
|
||||||
On_Regen();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,13 @@ using UnityEngine;
|
||||||
public class WorkerActor : Actor
|
public class WorkerActor : Actor
|
||||||
{
|
{
|
||||||
WorkerListTableData m_WorkerListTableData;
|
WorkerListTableData m_WorkerListTableData;
|
||||||
DropItem go_finditem;
|
DropItem _finditem;
|
||||||
|
DropItem go_finditem
|
||||||
|
{
|
||||||
|
get { return _finditem; }
|
||||||
|
set { _finditem = value; isFinditem = _finditem; }
|
||||||
|
}
|
||||||
|
bool isFinditem;
|
||||||
float SeekTime = 5f, t;
|
float SeekTime = 5f, t;
|
||||||
Actor m_Owner;
|
Actor m_Owner;
|
||||||
bool isOwner;
|
bool isOwner;
|
||||||
|
|
@ -16,7 +22,7 @@ public class WorkerActor : Actor
|
||||||
m_Role = eRole.Worker;
|
m_Role = eRole.Worker;
|
||||||
m_Owner = owner;
|
m_Owner = owner;
|
||||||
isOwner = m_Owner;
|
isOwner = m_Owner;
|
||||||
//m_Stat = new ActorStatInfo(m_Role, sdata, null);
|
m_Stat = new ActorStatInfo(m_Role, sdata, null);
|
||||||
|
|
||||||
m_WorkerListTableData = table_worker.Ins.Get_Data_orNull(_id);
|
m_WorkerListTableData = table_worker.Ins.Get_Data_orNull(_id);
|
||||||
if (!_ui)
|
if (!_ui)
|
||||||
|
|
@ -31,6 +37,7 @@ public class WorkerActor : Actor
|
||||||
|
|
||||||
public override void On_Regen(bool reincarnation = false, float healrate = 1)
|
public override void On_Regen(bool reincarnation = false, float healrate = 1)
|
||||||
{
|
{
|
||||||
|
Status = 0;
|
||||||
Set_Warp(Get_Pos());
|
Set_Warp(Get_Pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,29 +52,17 @@ public class WorkerActor : Actor
|
||||||
switch (Status)
|
switch (Status)
|
||||||
{
|
{
|
||||||
case 0: // 대기 중
|
case 0: // 대기 중
|
||||||
if (DSUtil.CheckNull(go_finditem) || !go_finditem.gameObject.activeInHierarchy)
|
if (!isFinditem || !go_finditem.gameObject.activeInHierarchy)
|
||||||
go_finditem = DropItemInfo.Ins.Get_NearestDropItem(Get_position());
|
go_finditem = DropItemInfo.Ins.Get_NearestDropItem(Get_position());
|
||||||
|
|
||||||
if (t > 0f)
|
if (t <= 0f && go_finditem && Set_Path(go_finditem.transform.position))
|
||||||
{
|
|
||||||
if (go_finditem)
|
|
||||||
{ // 다음 아이템으로 미리 가서 대기
|
|
||||||
Play_Run();
|
|
||||||
Set_Path(go_finditem.transform.position);
|
|
||||||
Status = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (go_finditem && Set_Path(go_finditem.transform.position))
|
|
||||||
{
|
{
|
||||||
Play_Run();
|
Play_Run();
|
||||||
Status = 2;
|
Status = 2;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (Status == 0 && isOwner && Vector3.Distance(m_Owner.Get_position(), Get_position()) > 3f)
|
if (!isFinditem && Status == 0 && isOwner && Vector3.Distance(m_Owner.Get_position(), Get_position()) > 3f)
|
||||||
{ // 캐릭터 근처로 옴
|
{ // 아이템이 없으므로 캐릭터 근처로 옴
|
||||||
Play_Run();
|
Play_Run();
|
||||||
Set_Path(Get_Pos());
|
Set_Path(Get_Pos());
|
||||||
Status = 1;
|
Status = 1;
|
||||||
|
|
@ -84,37 +79,10 @@ public class WorkerActor : Actor
|
||||||
if (CurAnim >= eAnim.Attack)
|
if (CurAnim >= eAnim.Attack)
|
||||||
{
|
{
|
||||||
if (!isPlaying())
|
if (!isPlaying())
|
||||||
{
|
End_Run();
|
||||||
Play_Idle();
|
|
||||||
Status = 0;
|
|
||||||
t = SeekTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (Complete_Destination())
|
else if (Complete_Destination())
|
||||||
{
|
End_Run();
|
||||||
if (!DSUtil.CheckNull(go_finditem))
|
|
||||||
{
|
|
||||||
if (go_finditem.gameObject.activeInHierarchy)
|
|
||||||
{
|
|
||||||
Play_Attack(Random.Range(0, 2), 1f);
|
|
||||||
if (go_finditem.ItemTouch(this))
|
|
||||||
ServerInfo.Ins.m_ServerData.Add_TitleCondition(46, 47); // 칭호 : 요정은 내 친구, 요정은 내 노예
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Play_Idle();
|
|
||||||
Status = 0;
|
|
||||||
t = SeekTime;
|
|
||||||
}
|
|
||||||
go_finditem = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Play_Idle();
|
|
||||||
Status = 0;
|
|
||||||
t = SeekTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3: // 아무것도 안함
|
case 3: // 아무것도 안함
|
||||||
if (CurAnim != eAnim.Idle && Complete_Destination())
|
if (CurAnim != eAnim.Idle && Complete_Destination())
|
||||||
|
|
@ -124,4 +92,22 @@ public class WorkerActor : Actor
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void End_Run()
|
||||||
|
{
|
||||||
|
Play_Idle();
|
||||||
|
Status = 0;
|
||||||
|
t = SeekTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnTriggerEnter(Collider other)
|
||||||
|
{
|
||||||
|
var dropitem = other.GetComponent<DropItem>();
|
||||||
|
if (dropitem)
|
||||||
|
{
|
||||||
|
dropitem.ItemTouch(this);
|
||||||
|
if (go_finditem == dropitem)
|
||||||
|
go_finditem = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ public class DropItem : ProjectileBase
|
||||||
{
|
{
|
||||||
if (gameObject.activeInHierarchy && touchActor)
|
if (gameObject.activeInHierarchy && touchActor)
|
||||||
{
|
{
|
||||||
if (touchActor.IsRole(eRole.PC) || touchActor.IsRole(eRole.Fairy))
|
if (touchActor.IsRole(eRole.PC) || touchActor.IsRole(eRole.Worker))
|
||||||
{
|
{
|
||||||
var sdata = ServerInfo.Ins.m_ServerData;
|
var sdata = ServerInfo.Ins.m_ServerData;
|
||||||
var statdata = touchActor.Get_StatInfo();
|
var statdata = touchActor.Get_StatInfo();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue