void Awake() { anim = GetComponent <Animator> (); rb = this.GetComponent <Rigidbody> (); what = this.GetComponent <PlayerMovement> (); dam = this.GetComponent <DamageSetGet> (); }
// Use this for initialization void Start() { thisAnim = this.GetComponent <Animator> (); pmov = player.GetComponent <PlayerMovement> (); rb = this.GetComponent <Rigidbody> (); otherAnim = player.GetComponent <Animator> (); ma = player.GetComponent <MachineAverage> (); dam = this.GetComponent <DamageSetGet> (); }
//public float time = 0f; //public bool canMoveSideways = true; void Awake() { rb = this.GetComponent <Rigidbody> (); anim = this.GetComponent <Animator> (); Physics.gravity = new Vector3(0, -20, 0); canMove = true; thisName = this.gameObject.name; pd = this.GetComponent <PlayerDetection> (); dam = this.GetComponent <DamageSetGet> (); ma = this.GetComponent <MachineAverage> (); }
void OnTriggerEnter(Collider other) { if (other.tag == hitTag && meDam.justHit == false) { hitValues = other.GetComponent <HitData> (); dir = other.GetComponentInParent <PlayerMovement> (); themDam = other.GetComponentInParent <DamageSetGet> (); themRB = other.GetComponentInParent <Rigidbody> (); Debug.Log("Current rotation:" + themRB.rotation); if (dir.facingRight) { meRB.velocity = new Vector3(hitValues.knockback * Mathf.Cos(hitValues.launchAngle * Mathf.PI / 180), hitValues.knockback * Mathf.Sin(hitValues.launchAngle * Mathf.PI / 180), 0) * Mathf.Pow(2, meDam.currentDamage / 100); } else { meRB.velocity = new Vector3(-hitValues.knockback * Mathf.Cos(hitValues.launchAngle * Mathf.PI / 180), hitValues.knockback * Mathf.Sin(hitValues.launchAngle * Mathf.PI / 180), 0) * Mathf.Pow(2, meDam.currentDamage / 100); } meDam.justHit = true; themDam.consecutiveHits++; anim.SetTrigger("hurt"); meDam.currentDamage += hitValues.damageAmount; Debug.Log(this.name + "Hit for damage: " + hitValues.damageAmount + "\nCurrent damage: " + meDam.currentDamage); } }
void Awake() { pcdam = PC.GetComponent <DamageSetGet> (); bgdam = BG.GetComponent <DamageSetGet> (); }
void Awake() { meDam = this.GetComponentInParent <DamageSetGet>(); meRB = this.GetComponentInParent <Rigidbody> (); anim = this.GetComponentInParent <Animator> (); }
// Use this for initialization void Awake() { posi = this.transform.position; rb = this.GetComponent <Rigidbody>(); hit = this.GetComponentInChildren <DamageSetGet> (); }