Ejemplo n.º 1
0
    // Token: 0x06005AB9 RID: 23225 RVA: 0x001F9F8C File Offset: 0x001F838C
    public void ApplySeatedAnimation(VRC.Player player)
    {
        RuntimeAnimatorController runtimeAnimatorController = this.animatorController;
        VRCAvatarManager          componentInChildren       = player.GetComponentInChildren <VRCAvatarManager>();

        if (runtimeAnimatorController != null)
        {
            if (runtimeAnimatorController.name == "SitStation")
            {
                runtimeAnimatorController = componentInChildren.GetSitAnimController();
            }
            if (runtimeAnimatorController == null)
            {
                Debug.LogError("SitAnimController on " + player.name + " is not available.", this);
            }
            else
            {
                this.AttachAnimatorControllerTo(player, runtimeAnimatorController);
            }
        }
        else
        {
            runtimeAnimatorController = componentInChildren.GetSitAnimController();
            if (runtimeAnimatorController == null)
            {
                Debug.LogError("SitAnimController on " + player.name + " is not available.", this);
            }
            else
            {
                this.AttachAnimatorControllerTo(player, runtimeAnimatorController);
            }
        }
    }
Ejemplo n.º 2
0
    // Token: 0x06005AC2 RID: 23234 RVA: 0x001FA728 File Offset: 0x001F8B28
    private void DetachAnimatorControllerFrom(VRC.Player player)
    {
        AnimatorControllerManager componentInChildren = player.GetComponentInChildren <AnimatorControllerManager>();

        if (componentInChildren != null)
        {
            componentInChildren.Pop();
        }
    }
Ejemplo n.º 3
0
    // Token: 0x06005ABE RID: 23230 RVA: 0x001FA5EC File Offset: 0x001F89EC
    private void AttachAnimatorControllerTo(VRC.Player player, RuntimeAnimatorController rac)
    {
        AnimatorControllerManager componentInChildren = player.GetComponentInChildren <AnimatorControllerManager>();

        if (componentInChildren != null && rac != null)
        {
            componentInChildren.Push(rac);
        }
        else
        {
            Debug.LogError("Failed to attach animator controller to " + player.name + ".", this);
        }
    }
Ejemplo n.º 4
0
    // Token: 0x06005AB6 RID: 23222 RVA: 0x001F9D5C File Offset: 0x001F815C
    public bool PlayerCanUseStation(VRC.Player player, bool log = false)
    {
        if (player == null)
        {
            return(false);
        }
        if (this.Occupant != null && this.Occupant.playerApi.playerId != player.playerApi.playerId)
        {
            if (log)
            {
                Debug.LogError(player.name + " cannot use station because it is occupied.", this);
            }
            return(false);
        }
        VRCAvatarManager componentInChildren = player.GetComponentInChildren <VRCAvatarManager>();

        if (componentInChildren == null)
        {
            if (log)
            {
                Debug.LogError(player.name + " cannot use station because they lack an AvatarManager.", this);
            }
            return(false);
        }
        if (!componentInChildren.IsHuman)
        {
            if (log)
            {
                Debug.LogError(player.name + " cannot use station because their avatar is not human.", this);
            }
            return(false);
        }
        if (this.isSeated)
        {
            if (player.GetComponentInChildren <AnimatorControllerManager>() == null)
            {
                if (log)
                {
                    Debug.LogError(player.name + " cannot use station because they have no AnimatorControllerManager.", this);
                }
                return(false);
            }
            RuntimeAnimatorController runtimeAnimatorController = this.animatorController;
            if (runtimeAnimatorController != null)
            {
                if (runtimeAnimatorController.name == "SitStation")
                {
                    runtimeAnimatorController = componentInChildren.GetSitAnimController();
                }
                if (runtimeAnimatorController == null)
                {
                    if (log)
                    {
                        Debug.LogError(player.name + " cannot use station because they lack a sit animation controller.", this);
                    }
                    return(false);
                }
            }
            else
            {
                runtimeAnimatorController = componentInChildren.GetSitAnimController();
                if (runtimeAnimatorController == null)
                {
                    if (log)
                    {
                        Debug.LogError(player.name + " cannot use station because they lack a sit animation controller.", this);
                    }
                    return(false);
                }
            }
        }
        return(true);
    }