Exemplo n.º 1
0
 private void RPCHandleClientAnimBool(NetworkUser arg1, ClientAnimatorBoolContainer arg2)
 {
     try
     {
         arg2.Execute();
     }
     catch (Exception ex) { }
 }
Exemplo n.º 2
0
 private void RPCHandleServerAnimBool(NetworkUser arg1, ClientAnimatorBoolContainer arg2)
 {
     try
     {
         foreach (var user in NetworkUser.readOnlyInstancesList)
         {
             if (arg1 != null)
             {
                 if (arg1.netId == user.netId)
                 {
                     continue;                           // skip issuer as it happens client side
                 }
             }
             NetClientRequestAnimBool.Invoke(arg2, user);
         }
     }
     catch (Exception ex) { }
 }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            base.OnEnter();

            // check if authority
            if (!base.isAuthority)
            {
                return;
            }
            #region networking
            if (isMovingContainer == null)
            {
                isMovingContainer = new ClientAnimatorBoolContainer();
                isMovingContainer.characterDirection = base.characterDirection.gameObject;
                isMovingContainer.animName           = "isMoving";
            }
            if (isGroundedContainer == null)
            {
                isGroundedContainer = new ClientAnimatorBoolContainer();
                isGroundedContainer.characterDirection = base.characterDirection.gameObject;
                isGroundedContainer.animName           = "isGrounded";
            }
            if (yVelocityContainer == null)
            {
                yVelocityContainer = new ClientAnimatorFloatContainer();
                yVelocityContainer.characterDirection = base.characterDirection.gameObject;
                yVelocityContainer.animName           = "yVelocity";
            }
            if (moveSpeedScaleContainer == null)
            {
                moveSpeedScaleContainer = new ClientAnimatorFloatContainer();
                moveSpeedScaleContainer.characterDirection = base.characterDirection.gameObject;
                moveSpeedScaleContainer.animName           = "moveSpeedScale";
            }
            thisInstance = base.GetComponent <NetworkIdentity>();
            thisUser     = NetworkUser.readOnlyInstancesList.Where(x => x.netId == thisInstance.netId).FirstOrDefault();
            #endregion
        }