mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Player.cs with camera mount
This commit is contained in:
parent
a971007e02
commit
f39f669d5e
@ -45,6 +45,7 @@ GameObject:
|
||||
- component: {fileID: 5494952544308740966}
|
||||
- component: {fileID: 5494952544308740984}
|
||||
- component: {fileID: 5494952544308740987}
|
||||
- component: {fileID: -6612530066273007424}
|
||||
m_Layer: 0
|
||||
m_Name: Player
|
||||
m_TagString: Untagged
|
||||
@ -170,3 +171,19 @@ Rigidbody:
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 1
|
||||
--- !u!114 &-6612530066273007424
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5494952544308740986}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6ca56588750e2488d972de17a0f71f5a, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
syncDirection: 0
|
||||
syncMode: 0
|
||||
syncInterval: 0
|
||||
cameraMount: {fileID: 5741080586963324589}
|
||||
|
8
Assets/Mirror/Examples/Shooter/Scripts.meta
Normal file
8
Assets/Mirror/Examples/Shooter/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ceee57e91e1142738e0d041d618f7ec
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
17
Assets/Mirror/Examples/Shooter/Scripts/Player.cs
Normal file
17
Assets/Mirror/Examples/Shooter/Scripts/Player.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Mirror.Examples.Shooter
|
||||
{
|
||||
public class Player : NetworkBehaviour
|
||||
{
|
||||
public Transform cameraMount;
|
||||
|
||||
public override void OnStartLocalPlayer()
|
||||
{
|
||||
// move main camera into camera mount
|
||||
Camera.main.transform.SetParent(cameraMount, false);
|
||||
Camera.main.transform.localPosition = Vector3.zero;
|
||||
Camera.main.transform.localRotation = Quaternion.identity;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Mirror/Examples/Shooter/Scripts/Player.cs.meta
Normal file
11
Assets/Mirror/Examples/Shooter/Scripts/Player.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ca56588750e2488d972de17a0f71f5a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user