Example #1
0
 public void AddObstacleToView(AObstacle obstacle, List <ViewContent> list)
 {
     for (uint i = 0; i < obstacle.Width; i++)
     {
         for (uint j = 0; j < obstacle.Height; j++)
         {
             if (obstacle.GetType().Equals(typeof(Bonus)))
             {
                 list.Add(new ViewContent(obstacle.GetCoordinates().Key, obstacle.GetCoordinates().Value, Settings.BonusColor, Settings.BonusView));
             }
             else if (obstacle.GetType().Equals(typeof(Block)))
             {
                 list.Add(new ViewContent(obstacle.GetCoordinates().Key, obstacle.GetCoordinates().Value, Settings.BlockColor, Settings.BlockView));
             }
         }
     }
 }
    protected void OnTriggerEnter(Collider c)
    {
        if (c.gameObject.layer == k_CoinsLayerIndex)
        {
            PoolSystem.instance.PoolIn(c.gameObject);
            CoinManager.instance.coinsAccum = 1;
        }
        else if (c.gameObject.layer == k_ObstacleLayerIndex)
        {
            c.enabled = false;

            AObstacle ob = c.gameObject.GetComponent <AObstacle>();

            if (ob != null)
            {
                ob.Impacted();
            }
            else
            {
                Destroy(c.gameObject);
            }
        }
    }
Example #3
0
 public ObstacleData(bool canUse, AObstacle prefab) : this()
 {
     this.canUse = canUse;
     this.prefab = prefab;
 }