Example #1
0
    private void InitUI()
    {
        photoUIobj      = uiRoot.GetUIView().gameObject;
        photoUIobj.name = "PhotoUIroot";
        GameObject g = Instantiate(Resources.Load("UI/Photo/Image")) as GameObject;

        g.transform.SetParent(photoUIobj.transform);
        specialEffectsUI = g.AddComponent <SpecialEffectsUI>();
        specialEffectsUI.Init();


        clickUi = new ClickUi(photoUIobj);
        if (collectPhoto == null)
        {
            collectPhoto = new CollectPhoto(specialEffectsUI, PhotoCameraObj);
        }
    }
Example #2
0
 public CollectPhoto(SpecialEffectsUI _SpecialEffectsUI, GameObject PhotoCameraObj)
 {
     specialEffectsUI = _SpecialEffectsUI;
     CollectIn        = MonoBehaviour.Instantiate(Resources.Load("photo/CollectIn")) as GameObject;
     CollectOut       = MonoBehaviour.Instantiate(Resources.Load("photo/CollectOut")) as GameObject;
     CollectIn.SetActive(false);
     CollectOut.SetActive(false);
     CollectIn.name  = "CollectIn";
     CollectOut.name = "CollectOut";
     CollectIn.transform.SetParent(PhotoCameraObj.transform);
     CollectOut.transform.SetParent(PhotoCameraObj.transform);
     CollectIn.transform.localPosition  = new Vector3(0, 0, 8);
     CollectOut.transform.localPosition = new Vector3(0, 0, 8);
     OutColors[0] = CollectOut.GetComponent <ParticleSystem>().startColor;
     foreach (Transform item in CollectOut.transform)
     {
         OutColors[i] = item.GetComponent <ParticleSystem>().startColor;
         i++;
     }
 }
Example #3
0
 public void Delete()
 {
     MonoBehaviour.Destroy(CollectIn);
     MonoBehaviour.Destroy(CollectOut);
     specialEffectsUI = null;
 }
Example #4
0
    public void ItemClick(GameObject obj, Vector2 pos, SpecialEffectsUI _effectsUI, MySkyInputEvent.ClickState ClickState)
    {
        if (IsItemClick == true)
        {
            return;
        }
        if (ClickState == MySkyInputEvent.ClickState.Down)
        {
            ClickItemData = FindItemData(obj);


            Debug.Log("====" + ClickItemData.cardType);
            if (ClickItemData != null && ClickItemData.cardType > 3)
            {
                return;
            }
            if (ClickItemData != null)
            {
                PhotoScene.Instance.clickUi.ClickUiObj.GetComponent <RectTransform>().position = new Vector3(pos.x, pos.y, 0);
                PhotoScene.Instance.clickUi.ClickUiObj.SetActive(true);
                ClickItemData.item.Photo.GetComponent <Renderer>().material.color = new Vector4(0.5f, 0.5f, 0.5f, 1);
                ClickItemData.item.BoderGlow.SetActive(true);
            }
            if (m_tmpDragState != MySkyInputEvent.DragState.OnDrag)
            {
                Speed          = 0;
                m_tmpDragState = MySkyInputEvent.DragState.OnDrag;
                return;
            }
        }
        else
        {
            if (ClickItemData != null && ClickItemData.cardType > 3)
            {
                if (ClickItemData.cardType == 4)
                {
                    ClickItemData.item.GetComponent <Animation>().Play();
                    ClickItemData.item.Clip.SetActive(true);
                    PhotoScene.Instance.StartCoroutine(Doyhongdong(ClickItemData.nid));
                }
                else
                {
                    ClickItemData.item.Clip.SetActive(true);
                    PhotoScene.Instance.StartCoroutine(Doyhongdong(ClickItemData.nid));
                }
                return;
            }

            m_effectsUI   = _effectsUI;
            ClickItemData = FindItemData(obj);
            if (ClickItemData != null)
            {
                m_TimeOnUpdateTow = 30;
                ClickItemData.item.Photo.GetComponent <Renderer>().material.color = ClickItemData.item.tmpColor;
                ClickItemData.item.BoderGlow.SetActive(false);
                MsgBase.QuitUI();
                IsItemClick = true;
                PhotoScene.Instance.clickUi.specialEffectsUI2.clickShow(ItemClickShowEnd);
            }
        }
    }