/// <summary> /// Initializes fields. /// </summary> void Start() { seeker = gameObject.GetComponent <Seeker>(); aiPath = gameObject.GetComponent <CustomAIPath>(); spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); coll = gameObject.GetComponent <Collider2D>(); startingScale = transform.localScale; startingZPos = GameManager.ZDepthMap.GetZDepthAtWorldPoint(transform.position); UpdateZPos(); }
void Init() { animator = GetComponent <Animator>(); animOverride = animator.runtimeAnimatorController as AnimatorOverrideController; if (animOverride == null) { animOverride = new AnimatorOverrideController(animator.runtimeAnimatorController); } else { animOverride = new AnimatorOverrideController(animOverride); } aiPath = GetComponent <CustomAIPath>(); worldItem = GetComponent <WorldItem>(); }