Example #1
0
    /// <summary>
    /// Invoked when networkedMatrixNetId is changed on the server, updating the client's networkedMatrixNetId.
    /// </summary>
    /// <param name="oldNetworkMatrixId"></param>
    /// <param name="newNetworkedMatrixNetID">uint of the new parent</param>
    private void SyncNetworkedMatrixNetId(uint oldNetworkMatrixId, uint newNetworkedMatrixNetID)
    {
        if (Initialized == false)
        {
            return;
        }

        networkedMatrixNetId = newNetworkedMatrixNetID;
        NetworkedMatrix.InvokeWhenInitialized(networkedMatrixNetId, FinishNetworkedMatrixRegistration);         //note: we dont actually wait for init here anymore
    }
Example #2
0
    public override void OnStartClient()
    {
        if (isServer)
        {
            return;
        }

        if (transform.parent == null)         //object spawned mid-round
        {
            NetworkedMatrix.InvokeWhenInitialized(networkedMatrixNetId, ClientLoading);
        }
        else
        {
            var matrix = transform.parent.GetComponentInParent <Matrix>();
            if (matrix.Initialized)
            {
                Initialize(matrix);
            }
        }
    }