Exemple #1
0
    public void CreateEquipmentCallBack(PreviewEquipment _eq)
    {
        //防止有之前延迟的模型加载,再次清理
        ClearModel();
        curPreviewEqObj = _eq;
        GameObject parent = GetModelTransform(_eq.PreviewPosition, _eq.PreviewRotation);

        if (null != parent)
        {
            _eq.transform.parent           = parent.transform;
            _eq.transform.localPosition    = new Vector3(0, -_eq.Height / 2f, 0);
            _eq.transform.localEulerAngles = new Vector3(0, 180f, 0);
        }
        _eq.FaceToNoLerp(180f);
        UIDragObjectRotate3D _UIDragObjectRotate3D = curShowLabel.gameObject.GetComponent <UIDragObjectRotate3D>();

        if (_UIDragObjectRotate3D == null)
        {
            _UIDragObjectRotate3D = curShowLabel.gameObject.AddComponent <UIDragObjectRotate3D>();
        }
        _UIDragObjectRotate3D.target = _eq;
        BoxCollider bc = curShowLabel.gameObject.GetComponent <BoxCollider>();

        if (bc == null)
        {
            curShowLabel.gameObject.AddComponent <BoxCollider>();
        }
        BindRenderAndUI(curShowLabel);
    }
Exemple #2
0
    public void CreateMountCallBack(PreviewMount _mob)
    {
        //防止有之前延迟的模型加载,再次清理
        ClearModel();
        curPreviewMount = _mob;
        GameObject parent = GetModelTransform(_mob.PreviewPosition, _mob.PreviewRotation);

        if (null != parent)
        {
            _mob.transform.parent           = parent.transform;
            _mob.transform.localPosition    = new Vector3(0, -_mob.Height / 2f, 0);
            _mob.transform.localEulerAngles = new Vector3(0, 180f, 0);
        }
        _mob.FaceToNoLerp(180f);
        UIDragObjectRotate3D _UIDragObjectRotate3D = curShowLabel.gameObject.GetComponent <UIDragObjectRotate3D>();

        if (_UIDragObjectRotate3D == null)
        {
            _UIDragObjectRotate3D = curShowLabel.gameObject.AddComponent <UIDragObjectRotate3D>();
        }
        _UIDragObjectRotate3D.target = _mob;
        BindRenderAndUI(curShowLabel);
    }
Exemple #3
0
    public void CreatePlayerCallBack(PreviewPlayer _player)
    {
        //防止有之前延迟的模型加载,再次清理
        ClearModel();
        previewCharacter = _player;
        GameObject parent = playerPosConfig ? GetModelTransform(_player.PreviewPos, _player.PreviewRotation) : GetModelTransform(Vector3.zero, Vector3.zero);

        if (null != parent)
        {
            previewCharacter.transform.parent        = parent.transform;
            previewCharacter.transform.localPosition = new Vector3(0, -(previewCharacter.Height / 2f - 0.25f), 0);
        }
        previewCharacter.FaceToNoLerp(180);
        UIDragObjectRotate3D _UIDragObjectRotate3D = curShowLabel.gameObject.GetComponent <UIDragObjectRotate3D>();

        if (_UIDragObjectRotate3D == null)
        {
            _UIDragObjectRotate3D = curShowLabel.gameObject.AddComponent <UIDragObjectRotate3D>();
        }
        _UIDragObjectRotate3D.target = _player;
        _UIDragObjectRotate3D.ResetPosition();
        BindRenderAndUI(curShowLabel);
    }
Exemple #4
0
    public void CreateEntourageCallBack(PreviewEntourage _ent)
    {
        // previewCamera.fieldOfView = 60.0f;
        //防止有之前延迟的模型加载,再次清理
        ClearModel();
        previewEntourage = _ent;
        GameObject parent = GetModelTransform(_ent.PreviewPosition, _ent.PreviewRotation);

        if (null != parent)
        {
            _ent.transform.parent           = parent.transform;
            _ent.transform.localPosition    = new Vector3(0, -_ent.Height / 2f, 0);
            _ent.transform.localEulerAngles = new Vector3(0, 180f, 0);
        }
        _ent.FaceToNoLerp(180f);
        UIDragObjectRotate3D _UIDragObjectRotate3D = curShowLabel.gameObject.GetComponent <UIDragObjectRotate3D>();

        if (_UIDragObjectRotate3D == null)
        {
            _UIDragObjectRotate3D = curShowLabel.gameObject.AddComponent <UIDragObjectRotate3D>();
        }
        _UIDragObjectRotate3D.target = _ent;
        BindRenderAndUI(curShowLabel);
    }