Beispiel #1
0
 private void Born()
 {
     AssetBundleManager.LoadAssetCompleteHandler handler = delegate(AssetBundleInfo abi) {
         player = GameObject.Instantiate(abi.mainObject) as GameObject;
         SimpleComponentUtil.SetParent(bornPlace, player.transform);
     };
     AssetBundleManager.Instance.Load(AssetPathDefinition.player, handler);
 }
Beispiel #2
0
    private GameObject GenLevelItem(LevelInfo lvInfo)
    {
        GameObject gameObj = GameObject.Instantiate(item);

        SimpleComponentUtil.SetParent(content, gameObj.transform);
        Text texComp = gameObj.transform.Find("Image/Text").GetComponent <Text>();

        texComp.text = lvInfo.id.ToString();

        GameObject imgGameObj = gameObj.transform.Find("Image").gameObject;

        imgGameObj.GetComponent <Button>().onClick.AddListener(delegate { lvInfo.openLvView(); });

        gameObj.SetActive(true);
        return(gameObj);
    }