// Use this for initialization void Start() { agent = GetComponent <NavMeshAgent>(); animator = GetComponent <Animator>(); ragdoll = GetComponent <RagdollUtility>(); //agent.destination = target.transform.position; }
public HumanoidDamageModule(float health, RagdollUtility ragdoll, HitReaction hitReaction, HumanoidAnimationModule animationModule, Transform headTransfrom, Transform chestTransfrom, OnDestoryDeligate onDestroyCallback, Outline outline) : base(health, onDestroyCallback, outline) { m_ragdoll = ragdoll; m_hitReaction = hitReaction; m_headTransform = headTransfrom; m_chestTransform = chestTransfrom; m_animationSystem = animationModule; }
public void Kill() { if (deadRagdoll) { var xf = (Transform)Instantiate(deadRagdoll, transform.position, transform.rotation); RagdollUtility.CopyPose(transform, xf); } onDead.Invoke(); gameObject.SetActive(false); Destroy(gameObject); }
//RectTransform healthTrans; void Start() { damageT = new WaitForSeconds(damageTimer); anim = GetComponentInChildren <Animator>(); bio = GetComponentInParent <Biostim>(); //GameObject slidH = Instantiate(sliderPrefabH, transform.position, Quaternion.identity) as GameObject; //slidH.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform); //healthSlider = slidH.GetComponentInChildren<Slider>(); //healthTrans = slidH.GetComponent<RectTransform>(); ragdollUtility = GetComponentInChildren <RagdollUtility>(); //substractOnce = false; }
void Awake() { animator = GetComponent <Animator>(); hitReaction = GetComponent <HitReaction>(); rigidbody = GetComponent <Rigidbody>(); if (targetPlayer == null) { targetPlayer = GameObject.FindGameObjectWithTag("Player"); } if (wayPoints.Length == 0) { wayPoints = GameObject.FindGameObjectsWithTag("WayPoint"); } if (blackBoard == null) { blackBoard = gameObject.GetComponent <Blackboard>(); } if (behaviourTree == null) { behaviourTree = gameObject.GetComponent <BehaviourTreeOwner>(); } if (blackBoard != null) { blackBoard.SetValue("target", targetPlayer); } if (behaviourTree != null) { List <GameObject> wps = new List <GameObject>(wayPoints); blackBoard.SetValue("PatrolWayPoints", wps); } currentHP = HP; ragdollUtility = GetComponent <RagdollUtility>(); }
void Start() { deadrobots = true; box = GetComponentInChildren <BoxCollider>(); damageT = new WaitForSeconds(damageTimer); anim = GetComponent <Animator>(); rot = GetComponentInChildren <Rotate>(); rot2 = GetComponentInChildren <Rotate2>(); Look = GetComponent <LookAtIK>(); GameObject slidH = Instantiate(sliderPrefabH, transform.position, Quaternion.identity) as GameObject; slidH.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform); healthSlider = slidH.GetComponentInChildren <Slider>(); healthTrans = slidH.GetComponent <RectTransform>(); ragdollUtility = GetComponentInChildren <RagdollUtility>(); fbbik = GetComponent <FullBodyBipedIK>(); capsul = GetComponent <CapsuleCollider>(); agent = GetComponent <UnityEngine.AI.NavMeshAgent>(); //substractOnce = false; dark = GameObject.FindGameObjectWithTag("Dark").GetComponent <DarkCity>(); }