Unity Tanks Game Lesson 2 Add Shell Creation and Firing - jasonweibel/HyperStream-Unity GitHub Wiki

Hyperstream : Unity Tanks Game - Lesson 2 - Add Shell Creation and Firing

Update TankShooting.cs File

  1. Open TankShooting.cs file in Visual Studio

  2. Uncomment public and private properties.

  3. Uncomment OnEnable method

  4. Uncomment Start method

  5. Uncomment Fire method

  6. Uncomment Update method

Update TankManager.cs File

  1. Open TankManager.cs file in Visual Studio

  2. Uncomment line 36.

  3. Uncomment line 57

  4. Uncomment line 67

Update ShellExplosion.cs File

  1. Open ShellExplosion.cs file in Visual Studio

  2. Uncomment public properties

  3. Uncomment Start method

  4. Uncomment CalculateDamage method

  5. Uncomment OnTriggerEnter method

Update TankShooting.cs File

  1. Open TankShooting.cs File in Visual Studio

  2. In Fire method uncomment lines 97 and 98.

  3. In Update method uncomment lines 64 and 65.

Add Tank Shooting Script to Tank Prefab

  1. Select Tank Prefab

  2. Add Script TankShooting

  3. Set Script Properties
    Todo - figure out how AimSlider gets assigned.

Add Shell Explosion Script to Shell Prefab

  1. Select Shell Prefab

  2. Add Shell Explosion Script Component

  3. Set Properties
    Drag the CompleteShellExplosion prefab onto the Explosion Particles property.

Attachments:

image2017-8-12_10-10-17.png (image/png)
image2017-8-12_10-10-30.png (image/png)
image2017-8-12_10-10-42.png (image/png)
image2017-8-12_10-11-11.png (image/png)
image2017-8-12_10-11-31.png (image/png)
image2017-8-12_10-12-24.png (image/png)
image2017-8-12_10-12-48.png (image/png)
image2017-8-12_10-13-8.png (image/png)
image2017-8-12_10-13-37.png (image/png)
image2017-8-12_10-13-50.png (image/png)
image2017-8-12_10-14-4.png (image/png)
image2017-8-12_10-14-21.png (image/png)
image2017-8-12_10-14-45.png (image/png)
image2017-8-12_10-14-57.png (image/png)
image2017-8-12_10-15-28.png (image/png)
image2017-8-12_10-15-56.png (image/png)
image2017-8-12_10-16-28.png (image/png)
image2017-8-12_10-16-49.png (image/png)
image2017-8-12_10-16-58.png (image/png)
image2017-8-12_10-17-3.png (image/png)
image2017-8-12_10-17-24.png (image/png)