Merge branch 'main' of https://github.com/Crizomb/ProjetAMJV_CR
This commit is contained in:
commit
fd649c831c
3 changed files with 23 additions and 2 deletions
|
@ -21578,6 +21578,10 @@ PrefabInstance:
|
||||||
propertyPath: m_IsActive
|
propertyPath: m_IsActive
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 8643972435321148278, guid: 9afbe58abb2af8bb6b4ba51160a048a0, type: 3}
|
||||||
|
propertyPath: _isQueen
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 8643972435321148278, guid: 9afbe58abb2af8bb6b4ba51160a048a0, type: 3}
|
- target: {fileID: 8643972435321148278, guid: 9afbe58abb2af8bb6b4ba51160a048a0, type: 3}
|
||||||
propertyPath: <IsQueen>k__BackingField
|
propertyPath: <IsQueen>k__BackingField
|
||||||
value: 1
|
value: 1
|
||||||
|
|
|
@ -12,7 +12,20 @@ public abstract class AbstractUnit : MonoBehaviour
|
||||||
{
|
{
|
||||||
public float price;
|
public float price;
|
||||||
[field: SerializeField] public bool IsTeamA { get; private set; }
|
[field: SerializeField] public bool IsTeamA { get; private set; }
|
||||||
[field: SerializeField] public bool IsQueen { get; set; }
|
|
||||||
|
[field: SerializeField]
|
||||||
|
protected bool _isQueen;
|
||||||
|
|
||||||
|
public virtual bool IsQueen
|
||||||
|
{
|
||||||
|
get => _isQueen;
|
||||||
|
set => SetQueen(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void SetQueen(bool isQueen)
|
||||||
|
{
|
||||||
|
_isQueen = isQueen;
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void TakeDamage(float damage);
|
public abstract void TakeDamage(float damage);
|
||||||
public abstract void Heal(float heal);
|
public abstract void Heal(float heal);
|
||||||
|
|
|
@ -19,7 +19,11 @@ public class MinecraftUnit : AbstractUnit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected override void SetQueen(bool isQueen)
|
||||||
|
{
|
||||||
|
_isQueen = isQueen;
|
||||||
|
transform.Find("Crown").gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
new void Awake()
|
new void Awake()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue