~saurabhs/bomberman

7388608e07c64eb0449d1ca35c6ca676e9cf65ec — Saurabh S 4 years ago 8d3e9ef
Minor code cleanup
2 files changed, 10 insertions(+), 3 deletions(-)

M Assets/Scripts/Core/Bomb.cs
M Assets/Scripts/Core/GameController.cs
M Assets/Scripts/Core/Bomb.cs => Assets/Scripts/Core/Bomb.cs +9 -2
@@ 46,7 46,7 @@ namespace Bomberman
        /// <summary>
        /// list of powerup to spawn from
        /// </summary>
        public List<GameObject> powerups;
        public List<GameObject> powerups = new List<GameObject>();

        /// <summary>
        /// flag to spawn only one 


@@ 61,6 61,14 @@ namespace Bomberman

        #endregion

        #region unity lifecycle 
        private void Start()
        {
            if ( powerups == null || powerups.Count == 0 )
                throw new System.Exception( "Invalid powerups collection." );
        }
        #endregion

        #region trigger response
        private void OnTriggerEnter( Collider collider )
        {


@@ 69,7 77,6 @@ namespace Bomberman
                //remove layer to avoid generating multiple explosions
                gameObject.layer = Constants.LAYER_DEFAULT;
                collider.gameObject.layer = Constants.LAYER_DEFAULT;
                ;

                //is hit by explosion effect
                StopCoroutine( bombExplosionRoutine );

M Assets/Scripts/Core/GameController.cs => Assets/Scripts/Core/GameController.cs +1 -1
@@ 40,7 40,7 @@ namespace Bomberman
                throw new System.Exception( "Cannot find any playerController references." );

            //enable yang for coop match
            bool isSinglePlayer = false;
            var isSinglePlayer = false;
            if ( isSinglePlayer = PlayerPrefs.GetInt( Constants.GAME_TYPE, Constants.COOP_ID ) != Constants.COOP_ID )
            {
                playerControllers[1].gameObject.SetActive( !isSinglePlayer );