设置相机
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -19,78 +19,12 @@ MonoBehaviour:
|
|||||||
BundleOptions: 256
|
BundleOptions: 256
|
||||||
Groups:
|
Groups:
|
||||||
- Name: UI
|
- Name: UI
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Rod
|
|
||||||
Enable: 1
|
Enable: 1
|
||||||
BundleMode: 0
|
BundleMode: 0
|
||||||
AddressMode: 2
|
AddressMode: 2
|
||||||
Tags:
|
Tags:
|
||||||
Collectors:
|
Collectors:
|
||||||
- {fileID: 102900000, guid: c25f5c6290af83046864490728fe8a4e, type: 3}
|
- {fileID: 102900000, guid: 064d656ec28baec4e984e51d3b9b7fc3, type: 3}
|
||||||
- {fileID: 102900000, guid: 45d122b30f8a6fe4caec588296da62dd, type: 3}
|
|
||||||
- {fileID: 102900000, guid: dc6a8d376a06e49409e88727f7e81f10, type: 3}
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Bait
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Bobber
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Hook
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Line
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Lure
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Reel
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
|
||||||
Filter: '*'
|
|
||||||
- Name: Weight
|
|
||||||
Enable: 1
|
|
||||||
BundleMode: 0
|
|
||||||
AddressMode: 2
|
|
||||||
Tags:
|
|
||||||
Collectors: []
|
|
||||||
FilterEnum: 0
|
FilterEnum: 0
|
||||||
Filter: '*'
|
Filter: '*'
|
||||||
- Name: Item
|
- Name: Item
|
||||||
@@ -98,14 +32,25 @@ MonoBehaviour:
|
|||||||
BundleMode: 0
|
BundleMode: 0
|
||||||
AddressMode: 2
|
AddressMode: 2
|
||||||
Tags:
|
Tags:
|
||||||
Collectors: []
|
Collectors:
|
||||||
FilterEnum: 0
|
- {fileID: 102900000, guid: 7e271954f63035a44a731c78c3b2e4da, type: 3}
|
||||||
Filter: '*'
|
FilterEnum: 1
|
||||||
- Name: Map
|
Filter: t:Prefab
|
||||||
|
- Name: Config
|
||||||
Enable: 1
|
Enable: 1
|
||||||
BundleMode: 3
|
BundleMode: 0
|
||||||
AddressMode: 2
|
AddressMode: 2
|
||||||
Tags:
|
Tags:
|
||||||
Collectors: []
|
Collectors:
|
||||||
FilterEnum: 2
|
- {fileID: 102900000, guid: 60ac19fbbe20cec48add96b79332c113, type: 3}
|
||||||
Filter: t:Scene
|
FilterEnum: 0
|
||||||
|
Filter: '*'
|
||||||
|
- Name: Plyaer
|
||||||
|
Enable: 1
|
||||||
|
BundleMode: 0
|
||||||
|
AddressMode: 2
|
||||||
|
Tags:
|
||||||
|
Collectors:
|
||||||
|
- {fileID: 102900000, guid: aa3f5467c0c153642ac320466aee0ec1, type: 3}
|
||||||
|
FilterEnum: 0
|
||||||
|
Filter: '*'
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ GameObject:
|
|||||||
- component: {fileID: 320747804}
|
- component: {fileID: 320747804}
|
||||||
- component: {fileID: 320747803}
|
- component: {fileID: 320747803}
|
||||||
- component: {fileID: 320747805}
|
- component: {fileID: 320747805}
|
||||||
|
- component: {fileID: 320747806}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: ---Camera---
|
m_Name: ---Camera---
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -424,6 +425,20 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier: Assembly-CSharp::NBF.Fishing2.CameraManager
|
m_EditorClassIdentifier: Assembly-CSharp::NBF.Fishing2.CameraManager
|
||||||
fppVCam: {fileID: 884989004}
|
fppVCam: {fileID: 884989004}
|
||||||
tppVCam: {fileID: 2016328100}
|
tppVCam: {fileID: 2016328100}
|
||||||
|
--- !u!114 &320747806
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 320747802}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1115c38f55a6434ba8ab2de810f955be, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier: Assembly-CSharp::NBF.CameraManager
|
||||||
|
Mode: 0
|
||||||
|
_cameraAsset: {fileID: 320747805}
|
||||||
--- !u!1 &386239068
|
--- !u!1 &386239068
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1388,7 +1403,6 @@ MonoBehaviour:
|
|||||||
videoPlayer: {fileID: 1810378423}
|
videoPlayer: {fileID: 1810378423}
|
||||||
startCanvas: {fileID: 386239068}
|
startCanvas: {fileID: 386239068}
|
||||||
playVideo: 0
|
playVideo: 0
|
||||||
controllerType: 0
|
|
||||||
--- !u!81 &2487858301405542861
|
--- !u!81 &2487858301405542861
|
||||||
AudioListener:
|
AudioListener:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ namespace NBF
|
|||||||
{
|
{
|
||||||
public CameraShowMode Mode = CameraShowMode.None;
|
public CameraShowMode Mode = CameraShowMode.None;
|
||||||
|
|
||||||
private CameraAsset _cameraAsset;
|
[SerializeField] private CameraAsset _cameraAsset;
|
||||||
private CameraShowMode _lastMode = CameraShowMode.None;
|
private CameraShowMode _lastMode = CameraShowMode.None;
|
||||||
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (_lastMode == Mode) return;
|
if (_lastMode == Mode) return;
|
||||||
@@ -30,7 +29,8 @@ namespace NBF
|
|||||||
//第一人称视角
|
//第一人称视角
|
||||||
SetFPPCam();
|
SetFPPCam();
|
||||||
}
|
}
|
||||||
_lastMode = Mode;
|
|
||||||
|
_lastMode = Mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -42,14 +42,15 @@ namespace NBF
|
|||||||
|
|
||||||
private void SetFPPCam()
|
private void SetFPPCam()
|
||||||
{
|
{
|
||||||
// var map = App.Main.GetComponent<Map>();
|
var player = FPlayer.Instance;
|
||||||
// var unityComponent = map.SelfMapUnit.GetComponent<UnitUnityComponent>();
|
if (player != null)
|
||||||
// if (unityComponent != null)
|
{
|
||||||
// {
|
_cameraAsset.fppVCam.LookAt = player.FppLook;
|
||||||
// _cameraAsset.fppVCam.LookAt = unityComponent.RootAsset.FppLook;
|
_cameraAsset.fppVCam.Follow = player.ModelAsset.NeckTransform;
|
||||||
// _cameraAsset.fppVCam.Follow = unityComponent.ModelAsset.NeckTransform;
|
// _cameraAsset.fppVCam.follow
|
||||||
// unityComponent.ModelAsset.LookIk.solver.target = unityComponent.RootAsset.FppLook;
|
// _cameraAsset.fppVCam.ResolveFollow()
|
||||||
// }
|
player.ModelAsset.LookIk.solver.target = player.FppLook;
|
||||||
|
}
|
||||||
|
|
||||||
_cameraAsset.fppVCam.Priority = 10;
|
_cameraAsset.fppVCam.Priority = 10;
|
||||||
_cameraAsset.tppVCam.Priority = 0;
|
_cameraAsset.tppVCam.Priority = 0;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace NBF.Fishing2
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static GameObject CreatePlayer(Transform parent, string modelName = "Player")
|
public static GameObject CreatePlayer(Transform parent, string modelName = "Player")
|
||||||
{
|
{
|
||||||
var model = LoadPrefab($"Player/{modelName}", parent);
|
var model = LoadPrefab($"Assets/ResRaw/Prefabs/Player/{modelName}.prefab", parent);
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
Assets/Scripts/Fishing/Player/FPlayer.Input.cs
Normal file
7
Assets/Scripts/Fishing/Player/FPlayer.Input.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace NBF
|
||||||
|
{
|
||||||
|
public class FPlayer_Input
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/Scripts/Fishing/Player/FPlayer.Input.cs.meta
Normal file
3
Assets/Scripts/Fishing/Player/FPlayer.Input.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ea2c2e2d4b4344f0bc9d58ba0aeec6fd
|
||||||
|
timeCreated: 1766505279
|
||||||
@@ -8,7 +8,7 @@ using UnityEngine.InputSystem;
|
|||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
public partial class FPlayer : MonoBehaviour
|
public partial class FPlayer : MonoService<FPlayer>
|
||||||
{
|
{
|
||||||
public Transform Root;
|
public Transform Root;
|
||||||
public Transform Eye;
|
public Transform Eye;
|
||||||
@@ -23,7 +23,7 @@ namespace NBF
|
|||||||
|
|
||||||
public FPlayerData Data { get; private set; }
|
public FPlayerData Data { get; private set; }
|
||||||
|
|
||||||
private void Awake()
|
protected override void OnAwake()
|
||||||
{
|
{
|
||||||
Character = gameObject.GetComponent<CharacterMovement>();
|
Character = gameObject.GetComponent<CharacterMovement>();
|
||||||
FirstPerson = gameObject.GetComponent<FirstPersonCharacter>();
|
FirstPerson = gameObject.GetComponent<FirstPersonCharacter>();
|
||||||
@@ -48,72 +48,7 @@ namespace NBF
|
|||||||
RemoveInputEvent();
|
RemoveInputEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Input
|
|
||||||
|
|
||||||
private void AddInputEvent()
|
|
||||||
{
|
|
||||||
InputManager.OnPlayerPerformed += OnPlayerCanceled;
|
|
||||||
InputManager.OnPlayerPerformed += OnPlayerPerformed;
|
|
||||||
|
|
||||||
InputManager.OnPlayerValueCanceled += OnPlayerValueCanceled;
|
|
||||||
InputManager.OnPlayerValuePerformed += OnPlayerValuePerformed;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveInputEvent()
|
|
||||||
{
|
|
||||||
InputManager.OnPlayerPerformed += OnPlayerCanceled;
|
|
||||||
InputManager.OnPlayerPerformed += OnPlayerPerformed;
|
|
||||||
|
|
||||||
InputManager.OnPlayerValueCanceled += OnPlayerValueCanceled;
|
|
||||||
InputManager.OnPlayerValuePerformed += OnPlayerValuePerformed;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerPerformed(string action)
|
|
||||||
{
|
|
||||||
if (action == InputDef.Player.Run)
|
|
||||||
{
|
|
||||||
Data.Run = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerCanceled(string action)
|
|
||||||
{
|
|
||||||
if (action == InputDef.Player.Run)
|
|
||||||
{
|
|
||||||
Data.Run = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerValueCanceled(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
var actionName = context.action.name;
|
|
||||||
if (actionName == InputDef.Player.Move)
|
|
||||||
{
|
|
||||||
// var v2 = context.ReadValue<Vector2>();
|
|
||||||
Data.MoveInput = Vector2.zero;
|
|
||||||
// SendMoveMessage(v2, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPlayerValuePerformed(InputAction.CallbackContext context)
|
|
||||||
{
|
|
||||||
// var mapUnit = Parent as MapUnit;
|
|
||||||
// Log.Info($"OnPlayerValuePerformed IsSelf={mapUnit.IsSelf()} id={mapUnit.Id}");
|
|
||||||
var actionName = context.action.name;
|
|
||||||
if (actionName == InputDef.Player.Move)
|
|
||||||
{
|
|
||||||
var v2 = context.ReadValue<Vector2>();
|
|
||||||
Data.MoveInput = v2;
|
|
||||||
// SendMoveMessage(v2, false);
|
|
||||||
}
|
|
||||||
else if (actionName == InputDef.Player.Look)
|
|
||||||
{
|
|
||||||
var v2 = context.ReadValue<Vector2>();
|
|
||||||
// UpdatePlayerRotation(v2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 角色模型
|
#region 角色模型
|
||||||
|
|
||||||
|
|||||||
@@ -11,5 +11,6 @@ namespace NBF
|
|||||||
public float RotationSpeed;
|
public float RotationSpeed;
|
||||||
|
|
||||||
public Vector2 MoveInput;
|
public Vector2 MoveInput;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@ namespace NBF
|
|||||||
{
|
{
|
||||||
public static Game Instance { get; private set; }
|
public static Game Instance { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
private static Scene _scene;
|
private static Scene _scene;
|
||||||
public static Scene Main => _scene;
|
public static Scene Main => _scene;
|
||||||
|
|
||||||
|
|||||||
@@ -162,6 +162,12 @@ namespace NBC.Asset.Editor
|
|||||||
assetData.Path = path;
|
assetData.Path = path;
|
||||||
assetData.BundleName = asset.Bundle;
|
assetData.BundleName = asset.Bundle;
|
||||||
assetData.Address = asset.Address;
|
assetData.Address = asset.Address;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(asset.Tags))
|
||||||
|
{
|
||||||
|
//assetData.SetTags(asset.Tags.Split(","));
|
||||||
|
}
|
||||||
|
|
||||||
_assets[path] = assetData;
|
_assets[path] = assetData;
|
||||||
//没后缀的默认加入地址 .prefab
|
//没后缀的默认加入地址 .prefab
|
||||||
var ext = Path.GetExtension(path);
|
var ext = Path.GetExtension(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user