Exemplo n.º 1
0
    //-------------------------------------------------------------------------------------------------
    //
    //
    //
    //-------------------------------------------------------------------------------------------------
    public static UnitResult Create(ResultType _type)
    {
        //ユニット詳細は1つしか開かない
        if (GetUnitResult() != null)
        {
            return(null);
        }

        GameObject _tmpObj = Resources.Load("Prefab/UnitResult2/UnitResult") as GameObject;

        if (_tmpObj == null)
        {
            return(null);
        }

        GameObject _insObj = Instantiate(_tmpObj) as GameObject;

        if (_insObj == null)
        {
            return(null);
        }

        UnitResult unitResult = _insObj.GetComponent <UnitResult>();

        unitResult.setup(_type);

        if (unitResult.m_Type == ResultType.Link)
        {
            if (unitResult.m_Canvas != null)
            {
                CanvasSetting canvasSetting = unitResult.m_Canvas.GetComponent <CanvasSetting>();
                if (canvasSetting != null)
                {
                    canvasSetting.ChangeLayerType(CanvasSetting.LayerType.DIALOG);
                }

                LoadingManager.Instance.setOverLayMask(true);
            }
        }

        UnityUtil.SetObjectEnabledOnce(_insObj, true);

        return(unitResult);
    }