Ejemplo n.º 1
0
        public void PS4Input_GetUsersDetails(int slot, object loggedInUser)
        {
            if (loggedInUser == null)
            {
                throw new System.ArgumentNullException("loggedInUser");
            }
#if PS4INPUT_NEW_PAD_API
            UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.GetUsersDetails(slot);
#else
            UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.PadGetUsersDetails(slot);
#endif
            Rewired.Platforms.PS4.Internal.LoggedInUser retUser = loggedInUser as Rewired.Platforms.PS4.Internal.LoggedInUser;
            if (retUser == null)
            {
                throw new System.ArgumentException("loggedInUser is not the correct type.");
            }

            retUser.status      = user.status;
            retUser.primaryUser = user.primaryUser;
            retUser.userId      = user.userId;
            retUser.color       = user.color;
            retUser.userName    = user.userName;
            retUser.padHandle   = user.padHandle;
            retUser.move0Handle = user.move0Handle;
            retUser.move1Handle = user.move1Handle;
#if UNITY_PS4_2018_PLUS
            retUser.aimHandle = user.aimHandle;
#endif
        }
Ejemplo n.º 2
0
 public object PS4Input_PadGetUsersDetails(int slot) {
     UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.PadGetUsersDetails(slot);
     return new Rewired.Platforms.PS4.LoggedInUser() {
         status = user.status,
         primaryUser = user.primaryUser,
         userId = user.userId,
         color = user.color,
         userName = user.userName,
         padHandle = user.padHandle,
         move0Handle = user.move0Handle,
         move1Handle = user.move1Handle
     };
 }
Ejemplo n.º 3
0
    int FindPrimaryUserSlot()
    {
#if UNITY_PS4
        for (int userSlot = 0; userSlot < 4; userSlot++)
        {
            UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.GetUsersDetails(userSlot);
            if (user.status != 0 && user.primaryUser)
            {
                return(userSlot);
            }
        }
#endif
        return(-1);
    }
Ejemplo n.º 4
0
        public object PS4Input_PadGetUsersDetails(int slot)
        {
#if UNITY_2018_PLUS
            UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.GetUsersDetails(slot);
#else
            UnityEngine.PS4.PS4Input.LoggedInUser user = UnityEngine.PS4.PS4Input.PadGetUsersDetails(slot);
#endif
            return(new Rewired.Platforms.PS4.LoggedInUser()
            {
                status = user.status,
                primaryUser = user.primaryUser,
                userId = user.userId,
                color = user.color,
                userName = user.userName,
                padHandle = user.padHandle,
                move0Handle = user.move0Handle,
                move1Handle = user.move1Handle
            });
        }