Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit 6ff0a6a

Browse files
committed
Added Standard Assests to common
I'm sure you guys will find it useful to use some of these standard assets - Characters - Cameras - CrossPlatformInput - Prototyping - Utility
1 parent b2545e9 commit 6ff0a6a

File tree

426 files changed

+44347
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

426 files changed

+44347
-1
lines changed

Assets/Common/Standard Assets.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Common/Standard Assets/Cameras.meta

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
In the Camera Prefabs folder are a few Camera Rigs, explained below.
3+
4+
To use them, simply drop one into your scene, and set the target field on the root of the camera rig.
5+
6+
If your player is tagged "Player", you don't even have to assign the target, as by default the cameras will automatically target the first object they find tagged "Player". You can uncheck this option if you don't want it.
7+
8+
After adding one to your scene, you will also probably want to delete the default "Main Camera" that was in your scene already, since the camera rigs contain their own cameras.
9+
10+
The "Free Look" camera is designed to follow a target's position, while allowing the user to rotate the angle of the camera with the mouse (or a touch gesture).
11+
12+
The "Multipurpose" camera is designed to follow a target's position and rotation (or direction of movement) and is useful for many game situations.
13+
14+
With the "Free Look" and "Multipurpose" camera, the rig is designed so the root object of the rig should always move towards the target's position. The camera offset is specified by the height (the Y value) of the "Pivot" object, and the forward offset of the final "Camera" object.
15+
16+
A typical set up for this would be to have the Y positional value of the Pivot set to 2 (for 2 meters above the target), and the Z positional value of the Camera set to -6 (for 6 meters behind the pivot).
17+
18+
If you wanted to adjust the camera to be to one side of the target (eg, for a closer over-shoulder third person view), you should adjust the X position value of the Pivot object.
19+
20+
Camera Rig <- position will move towards target.
21+
Pivot <- adjust Y position for height, X position for horizontal offset
22+
Camera <- adjust Z position for distance away from target
23+
24+
25+
Both the "Free Look" and the "Multipurpose" camera also use the ProtectCameraFromWallClip script, which is intended to stop the camera from passing through items of scenery, as can happen if a character or vehicle targeted by the camera is backed up against a wall.
26+
27+
The ProtectCameraFromWallClip script examines the distance between the Pivot and the Camera, and attempts to preserve this where possible, but draws the camera in closer to the pivot when colliders are detected. For this reason, if you're using the wall clip script, you can't modify the local offset of the Camera at runtime, because it's being set every frame by the clip protection script.
28+
29+
The "CCTV Camera" is a little different, being a single GameObject with no hierarchy. Since it doesn't move to follow a target (it only rotates), it doesn't need the wall clip script. Assigning the target works exactly the same as the other Cameras however, and it will also auto target any object tagged "player" unless told otherwise.
30+
31+
The CCTV camera uses the "LookAtTarget" script, which provides functionality above and beyond Unity's basic "Transform.LookAt" function. It works in local space relative to the object's parent, and allows constraints on the look angle which work relative to the object's starting rotation. Possible uses could be: A view out of the side window of a moving car, A turret which should aim at a target from a moving spaceship, or - as it's used in this case - a CCTV camera which can be placed anywhere and can pan towards a target.
32+
33+

Assets/Common/Standard Assets/Cameras/CameraGuidelines.txt.meta

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Common/Standard Assets/Cameras/Prefabs.meta

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1 &100000
4+
GameObject:
5+
m_ObjectHideFlags: 0
6+
m_PrefabParentObject: {fileID: 0}
7+
m_PrefabInternal: {fileID: 100100000}
8+
serializedVersion: 4
9+
m_Component:
10+
- 4: {fileID: 400000}
11+
- 20: {fileID: 2000000}
12+
- 124: {fileID: 12400000}
13+
- 92: {fileID: 9200000}
14+
- 81: {fileID: 8100000}
15+
- 114: {fileID: 11400000}
16+
- 114: {fileID: 11400002}
17+
m_Layer: 0
18+
m_Name: CctvCamera
19+
m_TagString: MainCamera
20+
m_Icon: {fileID: 0}
21+
m_NavMeshLayer: 0
22+
m_StaticEditorFlags: 0
23+
m_IsActive: 0
24+
--- !u!4 &400000
25+
Transform:
26+
m_ObjectHideFlags: 1
27+
m_PrefabParentObject: {fileID: 0}
28+
m_PrefabInternal: {fileID: 100100000}
29+
m_GameObject: {fileID: 100000}
30+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
31+
m_LocalPosition: {x: 234.210007, y: 92.913002, z: -126.029999}
32+
m_LocalScale: {x: 1, y: 1, z: 1}
33+
m_Children: []
34+
m_Father: {fileID: 0}
35+
m_RootOrder: 0
36+
--- !u!20 &2000000
37+
Camera:
38+
m_ObjectHideFlags: 1
39+
m_PrefabParentObject: {fileID: 0}
40+
m_PrefabInternal: {fileID: 100100000}
41+
m_GameObject: {fileID: 100000}
42+
m_Enabled: 1
43+
serializedVersion: 2
44+
m_ClearFlags: 1
45+
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
46+
m_NormalizedViewPortRect:
47+
serializedVersion: 2
48+
x: 0
49+
y: 0
50+
width: 1
51+
height: 1
52+
near clip plane: 1
53+
far clip plane: 4000
54+
field of view: 40
55+
orthographic: 0
56+
orthographic size: 5
57+
m_Depth: 0
58+
m_CullingMask:
59+
serializedVersion: 2
60+
m_Bits: 4294967295
61+
m_RenderingPath: -1
62+
m_TargetTexture: {fileID: 0}
63+
m_TargetDisplay: 0
64+
m_HDR: 0
65+
m_OcclusionCulling: 1
66+
m_StereoConvergence: 10
67+
m_StereoSeparation: .0219999999
68+
--- !u!81 &8100000
69+
AudioListener:
70+
m_ObjectHideFlags: 1
71+
m_PrefabParentObject: {fileID: 0}
72+
m_PrefabInternal: {fileID: 100100000}
73+
m_GameObject: {fileID: 100000}
74+
m_Enabled: 1
75+
--- !u!92 &9200000
76+
Behaviour:
77+
m_ObjectHideFlags: 1
78+
m_PrefabParentObject: {fileID: 0}
79+
m_PrefabInternal: {fileID: 100100000}
80+
m_GameObject: {fileID: 100000}
81+
m_Enabled: 1
82+
--- !u!114 &11400000
83+
MonoBehaviour:
84+
m_ObjectHideFlags: 1
85+
m_PrefabParentObject: {fileID: 0}
86+
m_PrefabInternal: {fileID: 100100000}
87+
m_GameObject: {fileID: 100000}
88+
m_Enabled: 1
89+
m_EditorHideFlags: 0
90+
m_Script: {fileID: 11500000, guid: f2ec2b96de5640e42a622fc3064f1c80, type: 3}
91+
m_Name:
92+
m_EditorClassIdentifier:
93+
m_Target: {fileID: 0}
94+
m_AutoTargetPlayer: 1
95+
m_UpdateType: 0
96+
m_RotationRange: {x: 90, y: 360}
97+
m_FollowSpeed: .100000001
98+
--- !u!114 &11400002
99+
MonoBehaviour:
100+
m_ObjectHideFlags: 1
101+
m_PrefabParentObject: {fileID: 0}
102+
m_PrefabInternal: {fileID: 100100000}
103+
m_GameObject: {fileID: 100000}
104+
m_Enabled: 0
105+
m_EditorHideFlags: 0
106+
m_Script: {fileID: 11500000, guid: a62942d9af3f36d448094c6ed1f214dd, type: 3}
107+
m_Name:
108+
m_EditorClassIdentifier:
109+
m_Target: {fileID: 0}
110+
m_AutoTargetPlayer: 1
111+
m_UpdateType: 0
112+
m_FovAdjustTime: 1
113+
m_ZoomAmountMultiplier: 2
114+
m_IncludeEffectsInSize: 0
115+
--- !u!124 &12400000
116+
Behaviour:
117+
m_ObjectHideFlags: 1
118+
m_PrefabParentObject: {fileID: 0}
119+
m_PrefabInternal: {fileID: 100100000}
120+
m_GameObject: {fileID: 100000}
121+
m_Enabled: 1
122+
--- !u!1001 &100100000
123+
Prefab:
124+
m_ObjectHideFlags: 1
125+
serializedVersion: 2
126+
m_Modification:
127+
m_TransformParent: {fileID: 0}
128+
m_Modifications: []
129+
m_RemovedComponents: []
130+
m_ParentPrefab: {fileID: 0}
131+
m_RootGameObject: {fileID: 100000}
132+
m_IsPrefabParent: 1

Assets/Common/Standard Assets/Cameras/Prefabs/CctvCamera.prefab.meta

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)