Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SwapDirection()
- {
- _spawnsRight = !_spawnsRight;
- transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
- }
- private void SpawnLightning()
- {
- if (_lightningSpawns < 1) { return; }
- ChainLightning lightning;
- if (_spawnsRight)
- {
- lightning = Instantiate(this, transform.position + transform.right * _spriteRenderer.size.x * 1.3f, Quaternion.identity).GetComponent<ChainLightning>();
- } else
- {
- lightning = Instantiate(this, transform.position - transform.right * _spriteRenderer.size.x * 1.3f, Quaternion.identity).GetComponent<ChainLightning>();
- // lightning.SwapDirection();
- }
- lightning.setSpawns(_lightningSpawns - 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement