Basic Dodging Enemy Creation #12
1406
Assets/Prefabs/Monsters/SpoopyAhLady_Monster.prefab
Normal file
1406
Assets/Prefabs/Monsters/SpoopyAhLady_Monster.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Prefabs/Monsters/SpoopyAhLady_Monster.prefab.meta
Normal file
7
Assets/Prefabs/Monsters/SpoopyAhLady_Monster.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 07ebda7671039dc4b9a1d1b4eabb5aa9
|
||||||
|
PrefabImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -56,7 +56,13 @@ public class Detection : MonoBehaviour
|
|||||||
Entity otherEntity = other.gameObject.GetComponent<Entity>();
|
Entity otherEntity = other.gameObject.GetComponent<Entity>();
|
||||||
if (otherEntity == _entityLinked)
|
if (otherEntity == _entityLinked)
|
||||||
{
|
{
|
||||||
_entityLinked.Hit(_projectileDamage);
|
if (EntityLinked.gameObject.GetComponent<GhostOpponent>() != null)
|
||||||
|
{
|
||||||
|
System.Random random = new System.Random();
|
||||||
|
if(random.Next(0, 99) > 25) _entityLinked.Hit(_projectileDamage);
|
||||||
|
}
|
||||||
|
else _entityLinked.Hit(_projectileDamage);
|
||||||
|
|
||||||
// Kill if no hp
|
// Kill if no hp
|
||||||
if (otherEntity.Hp <= 0)
|
if (otherEntity.Hp <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
25
Assets/Scripts/Opponent/GhostOpponent.cs
Normal file
25
Assets/Scripts/Opponent/GhostOpponent.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Transactions;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GhostOpponent : Opponent
|
||||||
|
{
|
||||||
|
|
||||||
|
//new public void Hit(int damage)
|
||||||
|
//{
|
||||||
|
// Hp -= damage;
|
||||||
|
MaximilienBB marked this conversation as resolved
Outdated
|
|||||||
|
|
||||||
|
// _lifeBar.value = _hp / (float)_maxHp;
|
||||||
|
|
||||||
|
// _shaderGUItext = Shader.Find("GUI/Text Shader");
|
||||||
|
// _shaderSpritesDefault = Shader.Find("Sprites/Default");
|
||||||
|
|
||||||
|
// foreach (SpriteRenderer renderer in _spriteRenderers)
|
||||||
|
// {
|
||||||
|
// renderer.material.shader = _shaderGUItext;
|
||||||
|
// }
|
||||||
|
// Invoke("ReturnNormalColor", 0.1f);
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/Opponent/GhostOpponent.cs.meta
Normal file
11
Assets/Scripts/Opponent/GhostOpponent.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ee7ccf7939877ae47a9ed9f555ea458e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -42,10 +42,6 @@ public class Opponent : Entity
|
|||||||
|
|
||||||
Move();
|
Move();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackEnemy()
|
void AttackEnemy()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user
Pourrais mettre la valeur du % pour dodge (le 25) en SerializedField