mirror of
https://github.com/Project-Redacted/project-hampter.git
synced 2025-06-05 18:23:13 +00:00
45 lines
No EOL
793 B
C#
45 lines
No EOL
793 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.AI;
|
|
|
|
public class RuntimeBaking : MonoBehaviour
|
|
{
|
|
|
|
public NavMeshSurface[] surfaces;
|
|
public Transform[] objectsToRotate;
|
|
|
|
|
|
// Use this for initialization
|
|
|
|
void Start()
|
|
{
|
|
|
|
StartCoroutine(Waiter());
|
|
|
|
|
|
}
|
|
|
|
IEnumerator Waiter()
|
|
{
|
|
|
|
yield return new WaitForSeconds(0.5f);
|
|
for (int j = 0; j < objectsToRotate.Length; j++)
|
|
{
|
|
objectsToRotate[j].localRotation = Quaternion.Euler(new Vector3(0, 50 * Time.deltaTime, 0) + objectsToRotate[j].localRotation.eulerAngles);
|
|
}
|
|
|
|
for (int i = 0; i < surfaces.Length; i++)
|
|
{
|
|
|
|
surfaces[i].BuildNavMesh();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |