Esempio n. 1
0
    void InsertDlc(Chapter item)
    {
        if (prefabPluginWnd == null)
        {
            prefabPluginWnd = Resources.Load("PluginWnd") as GameObject;
        }
        GameObject insert = GameObject.Instantiate(prefabPluginWnd);

        insert.transform.SetParent(PluginRoot.transform);
        insert.transform.localPosition = Vector3.zero;
        insert.transform.localScale    = Vector3.one;
        insert.transform.localRotation = Quaternion.identity;
        PluginCtrl ctrl = insert.GetComponent <PluginCtrl>();

        if (ctrl != null)
        {
            ctrl.AttachDlc(item);
        }
        pluginList.Add(ctrl);
    }
    void InsertDlc(Chapter item)
    {
        if (prefabPluginWnd == null)
        {
            prefabPluginWnd = ResMng.Load("PluginWnd") as GameObject;
        }
        GameObject insert = GameObject.Instantiate(prefabPluginWnd);

        insert.transform.SetParent(PluginRoot.transform);
        insert.transform.localPosition = Vector3.zero;
        insert.transform.localScale    = Vector3.one;
        insert.transform.localRotation = Quaternion.identity;
        PluginCtrl ctrl = insert.GetComponent <PluginCtrl>();

        if (ctrl != null)
        {
            ctrl.AttachDlc(item);
            if (!Main.Ins.GameStateMgr.gameStatus.IsDlcInstalled(item))
            {
                Main.Ins.DlcMng.AddPreviewTask(ctrl);
            }
        }
        pluginList.Add(ctrl);
    }