private void MakeThisChild(Transform parent) { GrabAbility grabAbility = parent.gameObject.GetComponent <GrabAbility>(); grabbedObjectPoint = grabAbility.grabbedObjectPoint; transform.parent = parent; float halfParentHeigth = parent.GetComponent <Collider2D>().bounds.extents.y; float myHeigth = collider.bounds.extents.y; offset = myHeigth + halfParentHeigth + .1f; }
private void Awake() { mOwner = GetComponent <Character>(); mAnimator = GetComponent <Animator>(); if (mFlipTransform != null) { mCachedFlipScale = mFlipTransform.localScale; } mCachedBlockAbility = Owner.AbilityController.GetAbility <BlockAbility>(); mCachedGrabAbility = Owner.AbilityController.GetAbility <GrabAbility>(); }