init 1.1.2
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using EmeraldAI;
|
||||
using EmeraldAI.Utility;
|
||||
|
||||
public class MoveToMousePosition : MonoBehaviour
|
||||
{
|
||||
EmeraldSystem EmeraldComponent;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
EmeraldComponent = GetComponent<EmeraldSystem>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
Ray ray;
|
||||
RaycastHit hit;
|
||||
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
|
||||
if (Physics.Raycast(ray, out hit, 80))
|
||||
{
|
||||
if (EmeraldComponent != null)
|
||||
{
|
||||
EmeraldAPI.Movement.SetCustomDestination(EmeraldComponent, hit.point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user