Gunnar Correa Logo

Modern Flashlight

Model created for the custom package with assets script for the application of its features.

Posted in: 2019-03-28 17:21:36 | Author: Gunnar Correa


Blender
Modeled with Blender 2.8 with a Low Poly look, with its relief map, the High Poly version is available.

Substance Painter
Textured with Substance Painter, the material has the maps of relief, roughness, metallic...emission.

Unity 3D
Included in the custom assets package, the mdoel has a script responsible for managing its functionality. There is also a battery model, which is distributed along with the flashlight.

Scripts
- Flashlight: It has control of on and off, with the customized keys, control of emission according to the card of the battery. It is possible to use the flashlight without the charging system, ie the battery never ends.
- Battery: Used in conjunction with the flashlight, it is possible to define which charge of each battery, key used to collect it and, if necessary, mark it as static, so it is left without interaction.

Sketachfab
See the template at: https://sketchfab.com/3d-models/modern-flashlight-6cbdee3c32b040e5aaacfd5b2545d579

BatteryFlashlight.cs

public KeyCode key = KeyCode.E;
public UnityEngine.UI.Text textButton;
public GameObject canvas;
public Flashlight flashlight;
public string playerTag = "Player";
public float chargeAmount = 300.0f;
[Space(10)]
public bool staticObject = false;

private new bool collider = false;

Flashlight.cs

#region "Variables"
[Header("CONTROLLER")]
	public float durantionSeconds = 300.0f;
	public bool enableBattery = true;
	public bool startOn = true;
	public KeyCode onKey = KeyCode.F;

[Header("LIGHT")]
	public new Light light;
	public Color lightColor;
	public float intensityMultiply = 1;

[Header("AUDIO")]
	public AudioSource audioSource;
	public AudioClip chargeSound;
	public AudioClip[] flashlightSounds;

	private bool on = true;
	private float currentTime;
	private bool effect = false;
#endregion

 


Modern Flashlight

Model created for the custom package with assets script for the application of its features.