コード例 #1
0
    void AddClickEvent()
    {
        //暂时无用
        BtnHome.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            SceneManager.LoadScene("Home");
            GameOperDelegate.GoToHome();
        });

        //暂时无用
        BtnEdit.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            JoinMainView joinMainView = transform.parent.GetComponentInChildren <JoinMainView>(true);
            DisplayView displayView   = transform.parent.GetComponentInChildren <DisplayView>(true);
            DestroyWindow();
            Destroy(displayView.gameObject);
            joinMainView.gameObject.SetActive(true);
            joinMainView.BackToJoinEdit();
            GameOperDelegate.GotoEdit();
        });

        BtnReplay.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            GameOperDelegate.Replay();
        });

        BtnDisplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            //NoDisplay表示从画册直接进入游戏,返回时返回画册,其余情况是从展示页进入的游戏,返回展示页
            if (GameManager.instance.displayType == DisplayType.NoDisplay)
            {
                GameManager.instance.SetNextSceneName(SceneName.Calendar);
                TransitionView.instance.OpenTransition();
            }
            else
            {
                GameManager.instance.displayType = DisplayType.BackDisplay;
                GameManager.instance.SetNextSceneName(SceneName.Display);
                TransitionView.instance.OpenTransition();
            }

            GameOperDelegate.GotoDisplay();
        });

        BtnContinue.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
        });

        BtnClose.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
        });
    }
コード例 #2
0
ファイル: JoinGuide.cs プロジェクト: zhongming1995/ZhihuiJoin
 //外部调用的JoinMainView
 public void AddMobileDrawDelagate()
 {
     if (joinMainView == null)
     {
         joinMainView = GetComponent <JoinMainView>();
     }
     joinMainView.mobilePaint.drawStart += OperationStart;
     joinMainView.mobilePaint.drawEnd   += OperationEnd;
 }
コード例 #3
0
ファイル: JoinGuide.cs プロジェクト: zhongming1995/ZhihuiJoin
 void Start()
 {
     joinMainView = GetComponent <JoinMainView>();
     cor_Reminder = StartCoroutine("CorReminder");
     DragReminder.gameObject.SetActive(false);
     DrawReminder.gameObject.SetActive(false);
     drawAniEvent = DrawReminder.GetComponent <AniEvent>();
     drawAniEvent.animationEndDelegate += OperationEnd;
     dragAniEvent = DragReminder.GetComponent <AniEvent>();
     dragAniEvent.animationEndDelegate += OperationEnd;
 }
コード例 #4
0
    private bool HasDrag;//本次触摸是否触发了拖拽

    void Init()
    {
        joinMainView      = GetComponentInParent <JoinMainView>();
        joinGuide         = GetComponentInParent <JoinGuide>();
        leftTop           = joinMainView.PosLeftTop.position;
        rightBottom       = joinMainView.PosRightBottom.position;
        anchorLeftTop     = joinMainView.PosLeftTop.GetComponent <RectTransform>().anchoredPosition;
        anchorRightBottom = joinMainView.PosRightBottom.GetComponent <RectTransform>().anchoredPosition;
        rt     = transform.GetComponent <RectTransform>();
        image  = transform.GetComponent <Image>();
        isInit = true;
    }
コード例 #5
0
    void Start()
    {
        rectImgDisplay = ImgDisplay.GetComponent <RectTransform>().sizeDelta;
        joinMainView   = transform.GetComponentInParent <Canvas>().gameObject.GetComponentInChildren <JoinMainView>(true);

        AddEvent();
        screenPosFlag1 = Camera.main.WorldToScreenPoint(PosFlag1.position);
        screenPosFlag2 = Camera.main.WorldToScreenPoint(PosFlag2.position);
        Display();
        //BtnSave.interactable = false;
        BtnGame.interactable = false; //保存按钮才可以用
        BtnBack.interactable = false; //保存按钮才可以用
        BtnHome.interactable = false; //保存按钮才可以用
        ShowMask(false);
    }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        joinMainView = transform.GetComponentInParent <JoinMainView>();
        joinGuide    = transform.GetComponentInParent <JoinGuide>();
        tg           = transform.GetComponent <ToggleGroup>();
        int count = transform.childCount;

        for (int i = 0; i < count; i++)
        {
            int    index = i;
            Toggle t     = transform.GetChild(i).GetComponent <Toggle>();
            t.group = tg;
            t.onValueChanged.AddListener(delegate
            {
                SelectOneColor(t.isOn, index);
            });
            toggleLst.Add(t);
        }
        toggleLst[2].isOn = true;

        //初始选中红色单色蜡笔
        joinMainView.SelectColor(2, GameData.instance.ColorList[2]);
    }
コード例 #7
0
ファイル: JoinPlus.cs プロジェクト: zhongming1995/ZhihuiJoin
 // Start is called before the first frame update
 void Awake()
 {
     joinMainView = GetComponent <JoinMainView>();
 }
コード例 #8
0
 void Start()
 {
     joinMainView = GetComponentInParent <JoinMainView>();
 }
コード例 #9
0
 void Start()
 {
     scrollRect   = transform.GetComponentInParent <ScrollRect>();
     joinMainView = GetComponentInParent <JoinMainView>();
     joinGuide    = GetComponentInParent <JoinGuide>();
 }
コード例 #10
0
    void AddClickEvent()
    {
        //暂时无用
        BtnHome.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            SceneManager.LoadScene("Home");
            GameOperDelegate.GoToHome();
        });

        //暂时无用
        BtnEdit.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            JoinMainView joinMainView = transform.parent.GetComponentInChildren <JoinMainView>(true);
            DisplayView displayView   = transform.parent.GetComponentInChildren <DisplayView>(true);
            Destroy(displayView.gameObject);
            joinMainView.gameObject.SetActive(true);
            joinMainView.BackToJoinEdit();
            CloseWindow();
            GameOperDelegate.GotoEdit();
        });

        BtnGame.onClick.AddListener(delegate
        {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            UIHelper.instance.LoadPrefab("Prefabs/game/window|window_choosegame", GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
        });

        BtnDisplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();

            /*
             * GameManager.instance.displayType = DisplayType.BackDisplay;
             * if (GameManager.instance.openType==OpenType.FirstEdit||GameManager.instance.openType==OpenType.BackEdit)
             * {
             *  GameManager.instance.SetNextViewPath(PanelName.DisplayView);
             *  UIHelper.instance.LoadPrefab(PanelName.TransitionView, GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
             * }
             * else
             * {
             *  GameManager.instance.SetNextViewPath(PanelName.CalendarDetailView);
             *  UIHelper.instance.LoadPrefab(PanelName.TransitionView, GameManager.instance.GetCanvas().transform, Vector3.zero, Vector3.one, true);
             * }
             */
            if (GameManager.instance.displayType == DisplayType.NoDisplay)
            {
                GameManager.instance.SetNextSceneName(SceneName.Calendar);
                TransitionView.instance.OpenTransition();
            }
            else
            {
                GameManager.instance.displayType = DisplayType.BackDisplay;
                GameManager.instance.SetNextSceneName(SceneName.Display);
                TransitionView.instance.OpenTransition();
            }

            GameOperDelegate.GotoDisplay();
        });

        BtnReplay.onClick.AddListener(delegate {
            AudioManager.instance.PlayAudio(EffectAudioType.Option, null);
            CloseWindow();
            GameOperDelegate.Replay();
        });
    }