Esempio n. 1
0
 private void Update()
 {
     if (TimeLease.CheckTime(gameObject.GetInstanceID().ToString(), 15))
     {
         StartCoroutine("EnemySpawn");
     }
 }
Esempio n. 2
0
 // 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;
 }
Esempio n. 3
0
    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");
        }
    }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     speed             = GameManager.Instance.AgentSpeed;
     collisionCollider = GetComponent <BoxCollider>();
     timerId           = TimeLease.NewTime(gameObject.GetInstanceID().ToString(), timer);
 }