/*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 OnCollisionEnter(Collision collision) { IA_Skeleton_code script = holder.GetComponent <IA_Skeleton_code>(); if (IsHiting && collision.gameObject == script.GetTarget()) { Debug.Log("hit"); script.ApplyDamage(collision.gameObject); IsHiting = false; } }
void Start() { Skeleton = gameObject.AddComponent <IA_Skeleton_code>(); Skeleton.SetTarget(null); Skeleton.SetAnimator(animator); Skeleton.SetWeapon(Weapon); ((enemy_couroutine)Skeleton).SetAttackRange(2); ((enemy_couroutine)Skeleton).SetMoveSpeed(3); ((enemy_couroutine)Skeleton).SetAttackDelay(1); ((enemy_couroutine)Skeleton).SetAttackDammage(27); Skeleton.StartCoroutine("CheckEntity"); }
void Awake() { Skeleton = gameObject.AddComponent <IA_Skeleton_code>(); Skeleton.SetTarget(null); Skeleton.SetAnimator(animator); Skeleton.SetWeapon(Weapon); ((enemy_couroutine)Skeleton).SetAttackRange(2.5f); ((enemy_couroutine)Skeleton).SetMoveSpeed(1.5f); ((enemy_couroutine)Skeleton).SetAttackDelay(1.5f); ((enemy_couroutine)Skeleton).SetAttackDammage(15); ((enemy_couroutine)Skeleton).SetHealth(300); Skeleton.StartCoroutine("CheckEntity"); MaxHp = Skeleton.GetHealth(); }
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"); } } }
void OnTriggerEnter(Collider collision) { IA_Skeleton_code script = holder.GetComponent <IA_Skeleton_code>(); Debug.Log(collision.gameObject.tag + " test"); if (IsHiting && collision.gameObject == script.GetTarget()) { Debug.Log("hit"); script.ApplyDamage(collision.gameObject); if (Random.Range(0, 10) == 1) { collision.gameObject.GetComponent <UnarmedCharacter>().status = Status.Bleeding; if (collision.gameObject.GetComponent <PlayerStat>().coroutine != null) { StopCoroutine(collision.gameObject.GetComponent <PlayerStat>().coroutine); } collision.gameObject.GetComponent <PlayerStat>().SetDOT_Time(5); collision.gameObject.GetComponent <PlayerStat>().coroutine = StartCoroutine(collision.gameObject.GetComponent <PlayerStat>().GetOverTime()); } IsHiting = false; } }
void Update() { IA_Skeleton_code script = holder.GetComponent <IA_Skeleton_code>(); IsHiting = script.Getanimator().GetCurrentAnimatorStateInfo(0).IsName("Attack1h1"); }
public void CallAllies() { IA_Skeleton_code script = ally.GetComponent <IA_Skeleton_code>(); script.SetTarget(target); }
// Start is called before the first frame update void Start() { skeleton = mob.gameObject.GetComponent <Coven.IA_Skeleton>().Skeleton; MaxHp = skeleton.GetHealth(); }