private void InitAIScripts() { Object obj = Resources.Load(_mData.PathPointsFile); // Object obj = Resources.Load("PathPoints/Copy1PathPoint1"); GameObject go = GameObject.Instantiate(obj) as GameObject; go.name = "AIPathPatrol"; go.transform.parent = U3DGameObject.transform; // AIBase script = go.GetComponent<AIPathPatrol>() as AIPathPatrol; // script.ControlGameObj = U3DGameObject; go = new GameObject(); go.name = "AIChase"; go.transform.parent = U3DGameObject.transform; AIChase chaseAI = go.AddComponent <AIChase>() as AIChase; chaseAI.ControlGameObj = U3DGameObject; chaseAI.Speed = MoveSpeed; }
private void Start() { aiChase = GetComponentInParent <AIChase>(); }