August 2018
Beginner
334 pages
10h 19m
English
We will develop the scripts for representing odor particles and agents that are able to smell:
using UnityEngine;
using System.Collections;
public class OdourParticle : MonoBehaviour
{
public float timespan;
private float timer;
}
void Start()
{
if (timespan < 0f)
timespan = 0f;
timer = timespan;
}
void Update()
{
timer -= Time.deltaTime;
if (timer < 0f)
Destroy(gameObject);
}
using UnityEngine; using System.Collections; using System.Collections.Generic; ...
Read now
Unlock full access