// Public functions public void SetCurrentLightGazeToObject(Transform transIn, bool reset) { currentLightGaze = transIn; currentLight.SetCurrentObject(transIn); currentLight.SetGazeTypeReset(LookAt.LookTypes.stareAtObject); currentLight.SetGazeTypeCurrent(LookAt.LookTypes.stareAtObject); if (reset) { StartCoroutine(StopStaringAtObject(currentLight)); } } // Calls private coroutine StopStaringAtObject() if(reset)
private IEnumerator StopStaringAtObject(LookAt lightIn) // Resets gazetype to idle { yield return(new WaitForSeconds(objectStareTimer)); lightIn.SetGazeTypeCurrent(resetType); lightIn.SetGazeTypeReset(resetType); }