Skip to content
Snippets Groups Projects
Commit fd113a91 authored by Dwi Bagus's avatar Dwi Bagus
Browse files

feat: add component ui

parent b0451915
Branches
1 merge request!1Master
Showing
with 37 additions and 9 deletions
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: EnemyAC
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers: []
fileFormatVersion: 2
guid: ab74e54b63766124ba32163636c0e2e1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2b47dfc889b252f428f639236a5eb5af
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -13,21 +13,21 @@ public class EnemyMovement : MonoBehaviour
{
player = GameObject.FindGameObjectWithTag ("Player").transform;
//playerHealth = player.GetComponent <PlayerHealth> ();
//enemyHealth = GetComponent <EnemyHealth> ();
playerHealth = player.GetComponent <PlayerHealth> ();
enemyHealth = GetComponent <EnemyHealth> ();
nav = GetComponent <UnityEngine.AI.NavMeshAgent> ();
}
void Update ()
{
//if (enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
//{
if (enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
{
nav.SetDestination (player.position);
//}
//else
//{
// nav.enabled = false;
//}
}
else
{
nav.enabled = false;
}
}
}
No preview for this file type
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment