| 1234567891011121314151617181920212223242526 |
- using PathCreation;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TreePath : MonoBehaviour
- {
- public List<PathCreator> paths;
- public PathCreator GetPath()
- {
- int randomInt = Random.Range(0, paths.Count);
- return paths[randomInt];
- }
- private void OnTriggerEnter(Collider other)
- {
- if (other.gameObject.layer == 8)
- {
- Monkey enemy = other.GetComponentInParent<Monkey>();
- enemy.pathCreator = GetPath();
- enemy.ChangeMonkeyState(Monkey.MonkeyState.Climb);
- }
- }
- }
|