Exemple #1
0
    // Use this for initialization
    public virtual void Start()
    {
        rend                 = GetComponent <SpriteRenderer> ();
        tileName             = gameObject.name;
        minedBoulder         = false;
        hasBuriedItems       = false;
        hasBuriedElements    = false;
        hasBuriedCodeNuggets = false;

        if (tileName.Contains(boulder))
        {
            hasBuriedElements = true;
        }

        if (hasBuriedItems || hasBuriedElements || hasBuriedCodeNuggets)
        {
            //because this tile has items, elements, or code nuggets, create the tileItem object
            tileItems = new TileItemManager();
            //and get the item spawn point list
            itemSpawnPoints = tileItems.tileItemSpawnPoints;

            if (hasBuriedItems)
            {
                Debug.Log("Added items to tile");
            }
            if (hasBuriedElements)
            {
                AddElementsToTile();
            }
            if (hasBuriedCodeNuggets)
            {
                Debug.Log("Added code nuggets to tile");
            }
        }
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        rend = GetComponent <SpriteRenderer> ();

        hasItems       = false;
        hasElements    = true;
        hasCodeNuggets = false;

        minedBoulder = false;

        //upon creation add appropriate amounts of items, elements and code nuggets to the boulder
        if (hasItems || hasElements || hasCodeNuggets)
        {
            //because this boulder has items, elements, or code nuggets, create the boulderItem object
            boulderItems = new TileItemManager();
            //and get the item spawn point list
            itemSpawnPoints = boulderItems.tileItemSpawnPoints;

            if (hasItems)
            {
                Debug.Log("Added items to boulder");
            }
            if (hasElements)
            {
                AddElementsToBoulder();
            }
            if (hasCodeNuggets)
            {
                Debug.Log("Added code nuggets to boulder");
            }
        }
    }