Exemplo n.º 1
0
    void Start()
    {
        targetContainer = Target.Container.Load(Path.Combine(Application.dataPath, Target.Container.FILE_NAME));
        spawnPoints     = GameObject.FindGameObjectsWithTag("SpawnPoint");
        Debug.Log("Icon name: " + this.transform.GetChild(0).name);

        this.transform.GetChild(0).GetComponent <Image> ().overrideSprite = Resources.Load(targetContainer.targets [itemIndex].iconTypePath, typeof(Sprite)) as Sprite;
        this.transform.GetChild(1).GetComponent <Text>().text             = targetContainer.targets [itemIndex].pointValue.ToString();
    }
Exemplo n.º 2
0
    private void createItems()
    {
        GameObject itemInstance;

        Target.Container targetsContainer = new Target.Container();
        targetsContainer.createItemsForLevel1();

        Debug.Log("Turgets Size: " + targetsContainer.targets.Count);
        for (int i = 0; i < targetsContainer.targets.Count; i++)
        {
            itemInstance = (GameObject)Instantiate(itemPrefub, transform);
            Item item = itemInstance.GetComponent <Item> ();
            item.itemIndex = i;
        }
    }