private void Update() { if (TimeLease.CheckTime(gameObject.GetInstanceID().ToString(), 15)) { StartCoroutine("EnemySpawn"); } }
// Update is called once per frame void Update() { if (TimeLease.CheckTime(timerId)) { GetNewRandom(); newForward = new Vector3(1 + randomness, 0, randomness); } forward = Vector3.Lerp(forward, newForward, timer * Time.deltaTime); gameObject.transform.rotation = Quaternion.LookRotation(Vector3.Lerp(gameObject.transform.forward, newForward, timer * Time.deltaTime)); gameObject.transform.position += forward * speed * Time.deltaTime; }
void Update() { if (moving) { Debug.Log("It got through it kinda"); TimeLease.NewTime(gameObject.GetInstanceID().ToString(), Random.Range(m_minTimer, m_maxTimer)); EjectBarrel(); Debug.Log("It got through it all"); } }
IEnumerator KillCore() { while (speed > 0) { speed = Mathf.Lerp(speed, 0.0f, decellRate * Time.deltaTime); if (speed < 0.1f) { speed = 0; } yield return(null); } TimeLease.RemoveTime(timerId); }
// Start is called before the first frame update void Start() { speed = GameManager.Instance.AgentSpeed; collisionCollider = GetComponent <BoxCollider>(); timerId = TimeLease.NewTime(gameObject.GetInstanceID().ToString(), timer); }