// Use this for initialization void Start() { yellowRanger = GameObject.Find("Yellow_BetaRanger(Clone)").GetComponent <YellowRanger>(); //gets the yellow ranger //assigns the values for move left,and damage based off of the yellow rangers data. moveLeft = yellowRanger.FacingLeft; damage = yellowRanger.Attack2Power; if (!moveLeft) //if not moving left then { Flip(); //flip asset } rBody2D = gameObject.GetComponent <Rigidbody2D>(); //get the electric ball rigidbody2D StartCoroutine(ElectricBallDuration()); //starts electric ball duration countdown }
private int lightningActive = 0; //keeps a count of how many chains of lightning were made and are still active #endregion // Use this for initialization void Start() { yellowRanger = GameObject.Find("Yellow_BetaRanger(Clone)").GetComponent <YellowRanger>(); //gets the yellow ranger //assigns the values for move left,and damages based off of the yellow rangers data. moveLeft = yellowRanger.FacingLeft; lightningShotDamage = yellowRanger.Attack2Power; chainDamage = yellowRanger.ChainedLightningDamage; if (!moveLeft) //if not moving left then { Flip(); //flip the asset } //gets the rigid body, sprite renderer, and collider 2D that is attached to the lighting shot. rBody2D = gameObject.GetComponent <Rigidbody2D>(); sprite = gameObject.GetComponent <SpriteRenderer>(); lightningShotCollider = gameObject.GetComponent <Collider2D>(); }