private void Initiate() { if (!playerTransform) { playerTransform = GameObject.FindGameObjectWithTag("Player").transform; } if (!movement) { movement = GetComponent <AIMovement>(); } if (!ps) { ps = GetComponent <PlatformerPhysicsSim>(); } if (!rb) { rb = GetComponent <Rigidbody>(); } if (!hitInfo) { hitInfo = GetComponentInChildren <RaycastHitInfo>(); } damageDealer = GetComponent <DamageDealer>(); // attack range to be <= to chase distance attackRange = Mathf.Min(attackRange, chaseDistance); InitiateAIBrain(); }
private void Start() { if (!targetTransform) { targetTransform = GameObject.FindGameObjectWithTag("Player").transform; } if (!controller) { controller = GetComponentInParent <AIController>(); } if (!movement) { movement = controller.GetComponent <AIMovement>(); } if (!body) { body = GetComponentInParent <Transform>(); } }
protected AIState(AIMovement movement) { this.movement = movement; }
void Awake() { instance = this; this._characterModel = this.transform.GetChild(0).gameObject; AIController.instance.charactorAnimator = this._characterModel.GetComponent <Animator>() as Animator; }
void Awake() { instance = this; this._characterModel = this.transform.GetChild(0).gameObject; AIController.instance.charactorAnimator = this._characterModel.GetComponent<Animator>() as Animator; }