forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83d66d3
commit 586a91b
Showing
19 changed files
with
246 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DataId,Name | ||
201000,ItemA | ||
201000,Battery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"items": [ | ||
{ | ||
"DataId": 201000, | ||
"Name": "ItemA" | ||
"Name": "Battery" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Client/Assets/Scripts/Contents/Map/Interactable/WorkStation/BatteryCharger.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
public class BatteryCharger : BaseWorkStation | ||
{ | ||
public Crew MyCrew => (Crew)MyWorker; | ||
|
||
protected override void Init() | ||
{ | ||
base.Init(); | ||
|
||
InteractDescription = "USE COMPUTER"; | ||
|
||
CanUseAgain = true; | ||
CanRememberWork = true; | ||
CanCollaborate = true; | ||
IsCompleted = false; | ||
|
||
TotalWorkAmount = 10f; | ||
} | ||
|
||
public override bool IsInteractable(Creature creature, bool isDoInteract) | ||
{ | ||
if (creature.CreatureType == Define.CreatureType.Alien) | ||
return false; | ||
|
||
if (!CanUseAgain && IsCompleted) | ||
return false; | ||
|
||
creature.IngameUI.InteractInfoUI.Show(InteractDescription.ToString()); | ||
|
||
if (CurrentWorkers.Count >= 3 || (!CanCollaborate && CurrentWorkers.Count >= 1)) | ||
return false; | ||
|
||
if (!(creature.CreatureState == Define.CreatureState.Idle || creature.CreatureState == Define.CreatureState.Move)) | ||
return false; | ||
|
||
if (((Crew)creature).Inventory.CurrentItem.ItemType != Define.ItemType.Battery) | ||
return false; | ||
|
||
if (isDoInteract) | ||
Interact(creature); | ||
|
||
return true; | ||
} | ||
|
||
public override void WorkComplete() | ||
{ | ||
MyCrew.Inventory.CurrentItemIdx = -1; | ||
|
||
base.WorkComplete(); | ||
} | ||
|
||
|
||
public override void PlayInteractAnimation() | ||
{ | ||
MyCrew.CrewAnimController.PlayKeypadUse(); | ||
} | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
Client/Assets/Scripts/Contents/Map/Interactable/WorkStation/BatteryCharger.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.