Esempio n. 1
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));
        }
    }
Esempio n. 2
0
    private void OnMouseDown0()
    {
        _curDragEleItem = null;
        Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100f, (1 << 8)))
        {
            _curDragEleItem = EleDataBase.Instance().GetOneEleItem(hit.collider.name);
            if (EleDataBase.Instance().IsCurDragTarget(_curDragEleItem))
            {
                _goScreenPos    = Camera.main.WorldToScreenPoint(_curDragEleItem.Go.transform.position);
                _offset         = _curDragEleItem.Go.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, _goScreenPos.z));
                _curCastEleItem = EleDataBase.Instance().GetCurStepItem().CurCastEleItem;
                Debug.Log("_curDragEleItem" + _curDragEleItem.Name);
                Debug.Log("_curCastEleItem" + _curCastEleItem.Name);
            }
            else
            {
                _curDragEleItem = null;
            }
        }
    }
Esempio n. 3
0
 private void StepNext()
 {
     EleDataBase.Instance().GetCurStepItem().CurDragEleItem.SetHighLighting(true);
 }