private void OnBackgroundRespawn(BGController background) { if (!BackgroundRespawner) { return; } bgManager.RespawnBG(background); }
public void RespawnBG(BGController bg) { if (bg != currentBG) { return; } BGController other = (bg == BG1) ? BG2 : BG1; other.transform.position = new Vector3(bg.transform.position.x, bg.transform.position.y, bg.transform.position.z + BackGroundDisplace); currentBG = other; }
private void OnCollisionEnter(Collision collision) { if (EnemyDestroyer) { IEnemy enemy = collision.gameObject.GetComponent <IEnemy>(); if (enemy != null) { OnEnemyDestroy(enemy); } } if (PlayerDestroyer) { PlayerController player = collision.gameObject.GetComponent <PlayerController>(); if (player != null) { OnPlayerDestroy(player); } } if (BulletDestroyer) { IBullet bullet = collision.gameObject.GetComponent <IBullet>(); if (bullet != null) { OnBulletDestroy(bullet); } } if (BackgroundRespawner) { BGController bg = collision.gameObject.GetComponent <BGController>(); if (bg != null) { OnBackgroundRespawn(bg); } } }
private void Start() { bg = transform.parent.gameObject.GetComponent <BGController>(); }
void Start() { bgc = GetComponent <BGController>(); scroll = 0; }
private void Awake() { Instance = this; }
// Use this for initialization void Start() { currentBG = BG2; }