コード例 #1
0
 private void OnBackgroundRespawn(BGController background)
 {
     if (!BackgroundRespawner)
     {
         return;
     }
     bgManager.RespawnBG(background);
 }
コード例 #2
0
    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;
    }
コード例 #3
0
    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);
            }
        }
    }
コード例 #4
0
 private void Start()
 {
     bg = transform.parent.gameObject.GetComponent <BGController>();
 }
コード例 #5
0
 void Start()
 {
     bgc    = GetComponent <BGController>();
     scroll = 0;
 }
コード例 #6
0
ファイル: BGController.cs プロジェクト: busiyg/UnityFishing
 private void Awake()
 {
     Instance = this;
 }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     currentBG = BG2;
 }