/*public void SetPlayer(GameObject player) * { * this.player=player; * }*/ public string GetScript(GameObject mob) { if (mob.GetComponent <IA_Skeleton_code>() != null) { Skeleton = mob.GetComponent <IA_Skeleton_code>(); return("Skeleton"); } if (mob.GetComponent <IA_Hob_Code>() != null) { Hob = mob.GetComponent <IA_Hob_Code>(); return("Hob"); } if (mob.GetComponent <IA_Albinos_code>() != null) { Dragon = mob.GetComponent <IA_Albinos_code>(); return("Dragon"); } if (mob.GetComponent <Skeleton_Dummie>() != null) { Dummie = mob.GetComponent <Skeleton_Dummie>(); return("Dummie"); } if (mob.GetComponent <Boss_IA>() != null) { Boss = mob.GetComponent <Boss_IA>(); return("Boss"); } return(null); }
void Update() { Debug.Log(IsHiting); //transform.position = purple.transform.position + decalage; IA_Albinos_code script = purple.GetComponent <IA_Albinos_code>(); IsHiting = script.Getanimator().GetCurrentAnimatorStateInfo(0).IsName("Basic attack") || script.Getanimator().GetCurrentAnimatorStateInfo(0).IsName("Claw Attack"); }
void OnTriggerStay(Collider collision) { IA_Albinos_code script = purple.GetComponent <IA_Albinos_code>(); if (IsHiting && collision.gameObject.tag == "Player") { IsHiting = false; Debug.Log("hit purple"); script.ApplyDamage(collision.gameObject); } }
void Start() { Albinos = gameObject.AddComponent <IA_Albinos_code>(); Albinos.SetTarget(null); Albinos.SetAnimator(animator); Albinos.SetWeapon(Weapon); ((enemy_couroutine)Albinos).SetAttackRange(0); ((enemy_couroutine)Albinos).SetMoveSpeed(4); ((enemy_couroutine)Albinos).SetAttackDelay(3); ((enemy_couroutine)Albinos).SetAttackDammage(49); ((enemy_couroutine)Albinos).SetFightingRange(15); ((enemy_couroutine)Albinos).SetHealth(1000); Albinos.StartCoroutine("CheckEntity"); }
public string GetScript(GameObject mob) { try { Skeleton = mob.GetComponent <IA_Skeleton_code>(); return("Skeleton"); } catch (System.NullReferenceException) { try { Hob = mob.GetComponent <IA_Hob_Code>(); return("Hob"); } catch (System.NullReferenceException) { Dragon = mob.GetComponent <IA_Albinos_code>(); return("Dragon"); } } }