public void DetachFromPlayer() { Debug.Log("Drop hat."); Hat.DetachFromPlayer(gameObject.GetComponent<Player>()); currentHat = null; hatType = Hat.HatType.None; }
public void AttachToPlayer() { Debug.Log("Pickup hat."); Hat.AttachToPlayer(gameObject.GetComponent<Player>(), closestHat); currentHat = closestHat; hatType = currentHat.hatType; }
void Awake() { base.Awake(); playerInput = GetComponent<PlayerInputScript>(); //Get reference to PlayerInputScript component spawningEffect = Resources.Load("Prefabs/PorterEffect") as GameObject; spawningEffect = Resources.Load("Prefabs/portalEffect") as GameObject; if (currentHat) hatType = currentHat.hatType; }