Skip to content

Docs clean-up #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/SuggestASolutionThatUsesExtenject.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ The markdwon used in the docs is like this:

<br/><br/>

* **Platform(s):** {Eg. iOS, Android and PlayStation}
* **Genre(s):** {Eg. E-Learning}
* **Platform(s):** {E.g. iOS, Android and PlayStation}
* **Genre(s):** {E.g. E-Learning}
* **Developer:** {Name of developer/company}

<br/><br/>
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Before creating enhancement suggestions, please check the list of enhancements s
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
* **List some other similar projects where this enhancement exists.**
* **Specify which version of the project you're using.**
* **Specify the current environment you're using.** if this is a useful information.
* **Specify the current environment you're using.** if this is useful information.
* **Provide a specific use case** - Often we get requests for a feature not realizing there is already a way to fulfill their use case. In other words, don't just give us a solution, give us a problem.


Expand Down
2 changes: 1 addition & 1 deletion Documentation/Async.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Alternatively you can inject an intermediary object that tracks the result of th

### Example

Lets see how we can inject async dependencies through an intermediary object. Async extensions implements `AsyncInject<T>` as this intermediary. You can use it as follows.
Let's see how we can inject async dependencies through an intermediary object. Async extensions implements `AsyncInject<T>` as this intermediary. You can use it as follows.


```csharp
Expand Down
2 changes: 1 addition & 1 deletion Documentation/DecoratorBindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Container.Decorate&lt;<b>ContractType</b>&gt;()

Where:

* **ContractType** = The type that is being decoratored. An object of this type will be injected into the DecoratorType class.
* **ContractType** = The type that is being decorated. An object of this type will be injected into the DecoratorType class.

* **DecoratorType** = The decorator class. This should be a concrete type and also should take as an injected parameter/field an object of type ContractType.

Expand Down
4 changes: 2 additions & 2 deletions Documentation/Factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Other things to be aware of:

- Validation can be especially useful for dynamically created objects, because otherwise you may not catch the error until the factory is invoked at some point during runtime (see the <a href="../README.md#object-graph-validation">validation section</a> for more details on validation)

- Note that for dynamically instantiated MonoBehaviours (for example when using `FromComponentInNewPrefab` with `BindFactory)` injection should always occur before `Awake` and `Start`, so a common convention we recommend is to use `Awake`/`Start` for initialization logic and use the inject method strictly for saving dependencies (ie. similar to constructors for non-monobehaviours)
- Note that for dynamically instantiated MonoBehaviours (for example when using `FromComponentInNewPrefab` with `BindFactory)` injection should always occur before `Awake` and `Start`, so a common convention we recommend is to use `Awake`/`Start` for initialization logic and use the inject method strictly for saving dependencies (i.e. similar to constructors for non-monobehaviours)

- Unlike non-factory injection, you can have multiple runtime parameters declared with the same type. In this case, the order that the values are given to the factory will be matched to the parameter order - assuming that you are using constructor or method injection. However, note that this is not the case with field or property injection. In those cases the order that values are injected is not guaranteed to follow the declaration order, since these fields are retrieved using `Type.GetFields` which does not guarantee order as described <a href="https://docs.microsoft.com/en-us/dotnet/api/system.type.getfields?redirectedfrom=MSDN&view=netcore-3.1#System_Type_GetFields">here</a>

Expand Down Expand Up @@ -567,7 +567,7 @@ Note that there is an equivalent method for memory pools called `BindMemoryPoolC

### Prefab Factory

In some cases you might want the code that is calling the Create method to also provide the prefab to use for the new object. You could directly call `DiContainer.InstantiatePrefabForComponent` but this would violate our rule of only injecting DiContainer into the 'composition root layer' (ie. factories and installers), so it would be better to write a custom factory like this instead:
In some cases you might want the code that is calling the Create method to also provide the prefab to use for the new object. You could directly call `DiContainer.InstantiatePrefabForComponent` but this would violate our rule of only injecting DiContainer into the 'composition root layer' (i.e. factories and installers), so it would be better to write a custom factory like this instead:

```csharp
public class Foo
Expand Down
4 changes: 2 additions & 2 deletions Documentation/GamesThatUseZenject.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Facebook via Oculus Studios acquired Beat Games in November 2019. The company st
<br/>

<img align="left" width="100" height="100" src="https://user-images.githubusercontent.com/7645831/95685582-fc712300-0bf8-11eb-81d7-4d01a617616e.png">
Pokémon Go is a augmented reality (AR) mobile game developed and published by Niantic in collaboration with The Pokémon Company for iOS and Android devices. A part of the Pokémon franchise, the game is the result of a collaboration between Niantic, Nintendo and The Pokémon Company. It uses the mobile device GPS to locate, capture, battle, and train virtual creatures, called Pokémon, which appear as if they are in the player's real-world location. The game is free-to-play; it uses a freemium business model and supports in-app purchases for additional in-game items. The game launched with around 150 species of Pokémon, which had increased to around 600 by 2020.
Pokémon Go is an augmented reality (AR) mobile game developed and published by Niantic in collaboration with The Pokémon Company for iOS and Android devices. A part of the Pokémon franchise, the game is the result of a collaboration between Niantic, Nintendo and The Pokémon Company. It uses the mobile device GPS to locate, capture, battle, and train virtual creatures, called Pokémon, which appear as if they are in the player's real-world location. The game is free-to-play; it uses a freemium business model and supports in-app purchases for additional in-game items. The game launched with around 150 species of Pokémon, which had increased to around 600 by 2020.
<br/>
<br/>
Pokémon Go was released to mixed reviews; critics praised the concept, but criticized technical problems. It was one of the most used and profitable mobile apps in 2016, having been downloaded more than 500 million times worldwide by the end of the year. It is credited with popularizing location-based and AR technology, promoting physical activity, and helping local businesses grow due to increased foot traffic. However, it attracted controversy for contributing to accidents and creating public nuisances. Various governments expressed concerns about security, and some countries regulate its use. By early 2019, the game had over a billion global downloads and grossed over $3 billion in revenue. The game also had over 147 million monthly active users as of May 2018
Expand Down Expand Up @@ -212,7 +212,7 @@ Ingress uses the mobile device GPS to locate and interact with "portals" which a
<br/>

<img align="left" width="100" height="100" src="https://user-images.githubusercontent.com/7645831/95634900-3d4b2980-0a8b-11eb-8706-b0976a3bdc9d.png">
Slugterra: Guardian Force – gather your invincible team of heroes and fight all enemies. In this game you will find yourself in a wonderful world inhabited by civilians Slagteri, the city which was attacked by horrible monsters and now your task will be to resist them. Lead your team of heroes forward and plan every step, becoming a skilled strategist and tactician. Explore the mysterious and dark caves filled with monsters and enemies and clean them, not letting enemies to harm local residents. Use power level and worked his way forward. Use the strength of each character to form a combined blow and destroy all enemies.
Slugterra: Guardian Force – gather your invincible team of heroes and fight all enemies. In this game you will find yourself in a wonderful world inhabited by civilians Slagteri, the city which was attacked by horrible monsters and now your task will be to resist them. Lead your team of heroes forward and plan every step, becoming a skilled strategist and tactician. Explore the mysterious and dark caves filled with monsters and enemies and clean them, not letting enemies harm local residents. Use power level and worked his way forward. Use the strength of each character to form a combined blow and destroy all enemies.

<br/>
<br/>
Expand Down
4 changes: 2 additions & 2 deletions Documentation/MemoryPools.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Before understanding memory pools it would be helpful to understand factories, s

It doesn't take long when developing games in Unity before you realize that proper memory management is very important if you want your game to run smoothly (especially on mobile). Depending on the constraints of the platform and the type of game you are working on, it might be very important to avoid unnecessary heap allocations as much as possible. One very effective way to do this is to use memory pools.

As an example let's look at at a case where we are dynamically creating a class:
As an example let's look at a case where we are dynamically creating a class:

```csharp
public class Foo
Expand Down Expand Up @@ -1388,7 +1388,7 @@ One mistake that can sometimes occur when using memory pools is that the spawned

This isn't always a problem and can sometimes even be intentional. Assuming the spawned object is not a MonoBehaviour, once the object is no longer used it will be automatically destroyed by the C# garbage collector anyway, so forgetting a `Despawn` in that case will not produce a memory leak. The only drawback is that when the object is not returned to the pool, it means the pool has to spawn more objects next time which can be slightly less efficient.

Also, of course, if you object has custom dispose logic that is important to run then that will be missed as well which could be a problem.
Also, of course, if your object has custom dispose logic that is important to run then that will be missed as well which could be a problem.

To detect these mistakes, Zenject includes an optional class that you can install that will throw exceptions when there are actively spawned objects when the scene is closed. Just add the following to one of your scene installers:

Expand Down
Loading