private void Awake() { RootNode root = AITreeHelper.Parser(transform, _aiMember); _aiController.Init(_aiMember, root); _aiController.StartAI(); _aiMember.Self.OnHpZero += _aiController.StopAI; }
private void Awake() { // 可以創建任何 有繼承 AIMemeber的Class 塞進去 AGAIMember agM = new AGAIMember(); GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); cube.name = "[IM AG TEST CUBE]"; cube.transform.position = Vector3.zero; agM.TestGameObject = cube; _aiMember = agM; RootNode root = AITreeHelper.Parser(transform, _aiMember); _aiController.Init(_aiMember, root); _aiController.StartAI(); }