private void Start() { inv = GetComponent <InvencibilityOnDamage>(); inv.charges = GameObject.FindWithTag("ScoreShield") .GetComponent <Score>().scorePoints; }
protected override void Trigger(GameObject other) { InvencibilityOnDamage inv = other.gameObject.GetComponent <InvencibilityOnDamage>(); if (inv) { inv.AddInvencibility(); } base.Trigger(other); }
private void Start() { inv = GetComponent <InvencibilityOnDamage>(); move = GetComponent <ObjectMoveWithRandomlyFactor>(); gridC = GameObject.FindWithTag("MapController").GetComponent <GridController>(); timer = Random.Range(attackDelay - 2, attackDelay + 3); anim = GetComponent <Animator>(); }
private bool HaveShield() { InvencibilityOnDamage inv = GetComponent <InvencibilityOnDamage>(); if (inv) { if (inv.charges > 0) { inv.Active(); return(true); } return(false); } else { return(false); } }