/** * gets called by lean event, when releasing stone from drag and puts it back to parent position or first sets the new parent */ public void OnDeselectOnUp() { if (_onDeselectParent != null && _onDeselectParent != Parent.GetComponent <CanHoldHookableObject>() && HookableObjectController.IsStoneInColliderOfOnDeselectParent(this, _onDeselectParent) ) { HookableObjectController.RemoveStoneFromCanHoldHookableObject(this, Parent); HookableObjectController.OnDeselectOnCanHoldHookableObject(this, _onDeselectParent); } //transform.position = SmoothTransition.AddTransition(gameObject, HookableObjectController.GetParentPositionOfChildStone(Parent.GetComponent <CanHoldHookableObject>(), this), Game.Instance.transitionTimes.snapBack); }
public override void OnActivate() { if (_player != null) { var transition = SmoothTransition.AddTransition(gameObject, _player.harpoon.transform.position, Game.Instance.transitionTimes.itemTransition); transition.onExit.AddListener(() => { _player.IgniteHarpoon(); DestroyHookableObject(); }); } else { DestroyHookableObject(); } }
/** * SetPosition sets the position of the hookable object * * @param position The position to set the hookable object to */ public void SetPosition(Vector3 position) { //gameObject.transform.position = position; SmoothTransition.AddTransition(gameObject, position, Game.Instance.transitionTimes.moveToInventory); }