예제 #1
0
 public void PickupObject(InteractablePickup pickupObject)
 {
     Debug.Log("Item is being picked up");
     m_PickedUpObject = pickupObject;
     m_PickedUpObject.transform.parent        = m_MovementModel.PreviewItemParent;
     m_PickedUpObject.transform.localPosition = Vector3.zero;
     //Hmm so localPosition is supposed to make sure the object is at the parent objects position
     //Altho its the parent im picking up, but it seems to work anyway
     //hmmm...
     m_MovementModel.SetFrozen(true, false, false);
     m_MovementModel.SetIsAbleToAttack(false);
     Helper.SetSortingLayerForAllRenderers(pickupObject.transform, "Characters");
     //Oh now it comes
     Physics2D.IgnoreCollision(m_Collider, pickupObject.GetComponent <Collider2D>());
 }
예제 #2
0
 public void UnFreeze()
 {
     if (MovementModel != null)
     {
         MovementModel.SetFrozen(false, false, false);
     }
     else
     {
         Debug.Log("Movementmodel is null");
     }
 }