Ejemplo n.º 1
0
    public void ShowPanel(PanelType panelType, params object[] sceneArgs)
    {
        if (panels.ContainsKey(panelType))
        {
            current = panels[panelType];
            current.gameObject.SetActive(false);
            current.Init();
        }
        else
        {
            string     name  = panelType.ToString();
            GameObject scene = new GameObject(name);
            current = scene.AddComponent(Type.GetType(name)) as PanelBase;
            //baseObj.Init(sceneArgs);
            current.gameObject.SetActive(false);
            current.Init();
            panels.Add(panelType, current);
            if (parentObj == null)
            {
                parentObj = GameObject.Find("UI Root").transform;
            }
            scene.transform.parent           = parentObj;
            scene.transform.localEulerAngles = Vector3.zero;
            scene.transform.localScale       = Vector3.one;
            scene.transform.localPosition    = Vector3.zero;

            LayerMgr.GetInstance().SetLayer(current.gameObject, LayerType.Panel);
        }
        StartShowPanel(current, current.showStyle, true);
    }
Ejemplo n.º 2
0
    public void SwitchScene(SceneType sceneType, params object[] sceneArgs)
    {
        string     name    = sceneType.ToString();
        GameObject scene   = new GameObject(name);
        SceneBase  baseObj = scene.AddComponent(Type.GetType(name)) as SceneBase;

        //baseObj.Init(sceneArgs);
        baseObj.OnInit(sceneArgs);
        if (parentObj != null)
        {
            parentObj = GameObject.Find("UI Root").transform;
        }
        scene.transform.parent = parentObj;


        LayerMgr.GetInstance().SetLayer(baseObj.gameObject, LayerType.Scene);

        scene.transform.localEulerAngles = Vector3.zero;
        scene.transform.localScale       = Vector3.one;
        scene.transform.localPosition    = Vector3.zero;
        if (name.Equals("SceneHome"))
        {
            switchRecorder.Clear();
        }

        switchRecorder.Add(new SwitchRecorder(sceneType, sceneArgs));
        if (current != null)
        {
            GameObject.Destroy(current);
        }

        current = scene;
    }
Ejemplo n.º 3
0
 private void NextPageButton()
 {
     if (LayerMgr.GetInstance().NextPage())
     {
         SetLayer();
         SetText();
         curSelect = -1;
     }
 }
Ejemplo n.º 4
0
 private void DeleteLayerButton()
 {
     if (curSelect == -1)
     {
         return;
     }
     LayerMgr.GetInstance().DeleteLayer(curSelect);
     SetLayer();
     SetText();
     curSelect = -1;
     SetAllNotSelect();
 }
Ejemplo n.º 5
0
    void Awake()
    {
        instance  = this;
        showColor = new byte[size * size * 4];
        material  = GetComponent <MeshRenderer>().material;
        pencil    = new Pencil();
        pencil.Init(this, size, size, curve);
        pen = new Pen();
        pen.Init(this, size, size, curve);
        eraser = new Eraser();
        eraser.Init(this, size, size, curve);
        curBrush = pen;

        layerMgr = LayerMgr.GetInstance();
    }
Ejemplo n.º 6
0
    public void SetLayer()
    {
        List <LayerData> list = LayerMgr.GetInstance().GetCurPageData();

        for (int i = 0; i < list.Count; i++)
        {
            if (list[i] == null)
            {
                GetLayerUI(i).gameObject.SetActive(false);
            }
            else
            {
                GetLayerUI(i).gameObject.SetActive(true);
                GetLayerUI(i).SetLayer(list[i]);
            }
        }
    }
Ejemplo n.º 7
0
    void Start()
    {
        max                = size * size;
        texture            = new Texture2D(size, size, TextureFormat.RGBA32, false);
        texture.filterMode = FilterMode.Bilinear;

        InitTexture();

        max = size * size;
        GetComponent <MeshRenderer>().material.SetTexture("_MainTex", texture);
        mBezier           = new Bezier();
        mSegment          = new Segment();
        TextureNeedUpdate = true;
        texture.LoadRawTextureData(whiteColor);
        texture.Apply();
        LayerMgr.GetInstance().Init(size, size, whiteColor);
    }
Ejemplo n.º 8
0
 private void NewLayerButton()
 {
     LayerMgr.GetInstance().AddLayer();
     SetLayer();
     SetText();
 }
Ejemplo n.º 9
0
 public void SetText()
 {
     pageMesText.text = "页数:" + LayerMgr.GetInstance().GetPageText();
 }
Ejemplo n.º 10
0
 public void CanPrintChange(Transform obj, bool val)
 {
     LayerMgr.GetInstance().SetCanPrint(GetObjVal(obj), val);
     SetLayer();
 }