Ejemplo n.º 1
0
    public bool IsCurDragTarget(EleItem item)
    {
        int      index = StepManager.Instance().CurSetpIndex - 1;
        StepItem temp  = GetOneStepItem(index);

        return(temp.CurDragEleItem.Name.Equals(item.Name));
    }
Ejemplo n.º 2
0
    public StepItem GetCurStepItem()
    {
        int      index = StepManager.Instance().CurSetpIndex - 1;
        StepItem temp  = GetOneStepItem(index);

        return(temp);
    }
Ejemplo n.º 3
0
 private void Update()
 {
     if (StepManager.Instance().GameState == StepManager.StepState.Gameing)
     {
         if (Input.GetMouseButtonDown(0))
         {
             _mouseDown = true;
             Debug.Log("OnMouseDown0();");
             OnMouseDown0();
         }
         if (Input.GetMouseButtonUp(0))
         {
             _mouseDown = false;
             Debug.Log("OnMouseUp0();");
             OnMouseUp0();
         }
         if (_mouseDown)
         {
             if (Input.GetAxis("Mouse X") != 0 || Input.GetAxis("Mouse Y") != 0)
             {
                 Debug.Log("OnMouseDrag0();");
                 OnMouseDrag0();
             }
             else
             {
             }
         }
     }
 }
Ejemplo n.º 4
0
    /// <summary>
    /// 仪器展示
    /// </summary>
    public IEnumerator EleIntroduceMove()
    {
        EleItem item    = EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex];
        var     tweener = Camera.main.transform.DOMove(item.LookPos, 0.3f);

        tweener.OnStart(() =>
        {
            Camera.main.transform.DORotateQuaternion(item.LookQua, 0.3f);
            if (_eleIntroduceMoveIndex > 0 && _eleIntroduceMoveIndex < EleDataBase.Instance().EleItems.Count)
            {
                EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex - 1].OffHighLighting();
            }
        });
        tweener.OnComplete(() =>
        {
            item.SetHighLighting(true);
            _eleIntroduceMoveIndex++;
        });
        yield return(new WaitForSeconds(2f));

        if (_eleIntroduceMoveIndex < EleDataBase.Instance().EleItems.Count)
        {
            StartCoroutine(EleIntroduceMove());
        }
        else
        {
            Camera.main.transform.DOMove(DefaultTran.position, 0.3f).OnStart(
                () => {
                Camera.main.transform.DORotateQuaternion(DefaultTran.rotation, 0.3f);
                EleDataBase.Instance().EleItems[_eleIntroduceMoveIndex - 1].OffHighLighting();
            }).OnComplete(
                () => StepManager.Instance().ChangeGameState(StepManager.StepState.Gameing));
        }
    }
Ejemplo n.º 5
0
        internal void UpdateDesc()
        {
            string str = StepManager.Instance().GetCurStepDesc();

            SetCurDesc(str);
            string strAll = StepManager.Instance().GetAllDesc();

            SetAllDesc(strAll);
        }
Ejemplo n.º 6
0
 private void ShowOrHideAllDesc(BaseEventData arg0)
 {
     if (AllDesc.gameObject.activeInHierarchy)
     {
         AllDesc.gameObject.SetActive(false);
     }
     else
     {
         AllDesc.gameObject.SetActive(true);
         string str = StepManager.Instance().GetAllDesc();
         SetAllDesc(str);
     }
 }
Ejemplo n.º 7
0
 private void Start()
 {
     BtnNext.onClick.AddListener(OnClickNext);
     BtnLast.onClick.AddListener(OnClickLast);
     BtnClose.onClick.AddListener(() =>
     {
         UIManager.Instance().HidePanel(UIManager.PanelType.PanelShowDes);
         if (StepManager.Instance().GameState == StepManager.StepState.None)
         {
             EventBase.Instance().DoEleIntroduceMove();
         }
     });
     mIndex = 0;
     ShowTargetImage();
 }
Ejemplo n.º 8
0
 private void Update()
 {
     if (StepManager.Instance().GameState == StepManager.StepState.Gameing)
     {
         if (_countDowner > 0)
         {
             _countDowner -= Time.deltaTime;
         }
         else
         {
             LeftTime.text = StepManager.Instance().GetLastTime();
             _countDowner  = 1;
         }
     }
 }
Ejemplo n.º 9
0
 public void ShowOrHide(bool close = false)
 {
     if (Go.activeInHierarchy || close)
     {
         if (AllDesc.gameObject.activeInHierarchy)
         {
             AllDesc.gameObject.SetActive(false);
         }
         Go.SetActive(false);
     }
     else
     {
         EventBase.Instance().EveCloseOtherTweenBar(-1);
         Go.SetActive(true);
         string str = StepManager.Instance().GetCurStepDesc();
         SetCurDesc(str);//(Regex.Unescape(str));
     }
 }
Ejemplo n.º 10
0
    private void InitData()
    {
        _congfigStep = (ConfigStep)ConfigManager.Instance().GetConfig(ConfigType.ConfigStep);
        Transform tran = GameObject.Find("StepObjs").transform;

        EleItems = new List <EleItem>(tran.childCount);
        for (int i = 0; i < tran.childCount; i++)
        {
            EleItem item = new EleItem(tran.GetChild(i));
            EleItems.Add(item);
        }
        StepItems = new Dictionary <int, StepItem>(5);

        for (int i = 0; i < _congfigStep.ConfigDatas.Count; i++)
        {
            StepItem sItem = new StepItem();
            sItem.Index          = i;
            sItem.Desc           = StepManager.Instance().GetCurStepDesc(i);
            sItem.CurDragEleItem = EleItems.Find(x => x.Name.Equals(_congfigStep.Get(i + 1).dragName));
            sItem.CurCastEleItem = EleItems.Find(x => x.Name.Equals(_congfigStep.Get(i + 1).castName));
            StepItems.Add(i, sItem);
        }
    }
Ejemplo n.º 11
0
 private void DoEleIntroduceMove()
 {
     StepManager.Instance().ChangeGameState(StepManager.StepState.Introdece);
     StartCoroutine(EleIntroduceMove());
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 播放动画
 /// </summary>
 public void PlayAni()
 {
     Go.transform.DORotate(Vector3.right, 2).OnComplete(() => { Go.transform.DORotateQuaternion(DefaultQua, 0.5f).OnStart(() => TweenToPos(DefaultPos, () => StepManager.Instance().StepToNext())); });
 }
Ejemplo n.º 13
0
 private void UpdateScore()
 {
     Score.text = StepManager.Instance().GetScore();
 }