Exemple #1
0
    /*
     * 创建敌人并将其移动到场上
     * 此函数所创建的敌人处于已激活的状态
     */
    public GameObject createEnemy(string source)
    {
        GameObject enemy = GameObject.Instantiate(GlobalPrefab.Actor);

        enemy.GetComponent <ActorCtrl>().loadData(DodResources.GetActorData(source));
        this.actors.Add(enemy);
        enemy.GetComponent <ActorCtrl>().activate();
        return(enemy);
    }
Exemple #2
0
    /*
     * 创建干员并将其移动到sideBar
     * 此函数所创建的干员处于未激活的状态
     */
    public GameObject createOprt(string source)
    {
        GameObject oprt = GameObject.Instantiate(GlobalPrefab.Actor);
        ActorData  data = DodResources.GetActorData(source);

        if (data == null)
        {
            Debug.Log("NotFound");
            data = DodResources.GetActorData("DefaultOprt");
            Debug.Log(data.type);
        }
        oprt.GetComponent <ActorCtrl>().loadData(DodResources.GetActorData(source));
        this.sideBar.Add(oprt);
        return(oprt);
    }