Skip to content

Commit 0dcb29c

Browse files
committed
Add documentation for the Unity Asset Store
1 parent 3277200 commit 0dcb29c

File tree

8 files changed

+76
-1
lines changed

8 files changed

+76
-1
lines changed

Assets/CameraMultiTarget/Documentation.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Dynamic Multi Target Camera for Unity
2+
3+
Concise Unity library which dynamically keeps a set of objects (e.g. players and important objects) in view, a common problem for a wide range of games. This asset is a direct build from the source code available on [GitHub](https://github.com/lopespm/unity-camera-multi-target).
4+
5+
More information about the library's inner workings and underlying math is available in the related [blog article](https://lopespm.github.io/libraries/games/2018/12/27/camera-multi-target.html)
6+
7+
The library was developed for, and used by [Survival Ball](https://survivalball.com/). The game has an heavy shared screen local co-op component, which requires the camera to dynamically keep many key elements in view.
8+
9+
10+
## Install
11+
12+
Import the `CameraMultiTarget` folder into your project when installing it from the Asset Store.
13+
14+
15+
## Usage
16+
17+
Add the [`CameraMultiTarget`](Assets/CameraMultiTarget/Library/CameraMultiTarget.cs) component to a camera and then you can programatically set which game objects the camera will track via the component's [`SetTargets(GameObject[] targets)`](Assets/CameraMultiTarget/Library/CameraMultiTarget.cs#L23) method.
18+
19+
For example, you can set the targets in your game controller component (if you choose to have one), like the following:
20+
21+
public class ExampleGameController : MonoBehaviour
22+
{
23+
public CameraMultiTarget cameraMultiTarget;
24+
25+
private void Start() {
26+
var targets = new List<GameObject>();
27+
targets.Add(CreateTarget());
28+
targets.Add(CreateTarget());
29+
targets.Add(CreateTarget());
30+
cameraMultiTarget.SetTargets(targets.ToArray());
31+
}
32+
33+
private GameObject CreateTarget() {
34+
GameObject target = GameObject.CreatePrimitive(PrimitiveType.Capsule);
35+
target.transform.position = Random.insideUnitSphere * 10f;
36+
return target;
37+
}
38+
}
39+
40+
41+
## Example Scene
42+
43+
An example scene of the library's usage is included in the `CameraMultiTarget/Example` folder.

Assets/CameraMultiTarget/Documentation/README.md.meta

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

Assets/CameraMultiTarget/Documentation/README.pdf.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
pandoc README.md -s -o README.pdf --variable colorlinks=true -V geometry:margin=1.3in

Assets/CameraMultiTarget/Documentation/build_readme_pdf.sh.meta

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

ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ PlayerSettings:
117117
16:10: 1
118118
16:9: 1
119119
Others: 1
120-
bundleVersion: 1.1
120+
bundleVersion: 1.2
121121
preloadedAssets: []
122122
metroInputSource: 0
123123
wsaTransparentSwapchain: 0

0 commit comments

Comments
 (0)