public void OnEnable() { HumanoidUnet probe = (HumanoidUnet)target; //if (probe.humanoid == null) // SetHumanoid(probe); }
[ClientCallback] // @ remote client public void ClientProcessAvatarPose(NetworkMessage msg) { reader = msg.reader; int nwId = ReceiveInt(); int humanoidId = ReceiveInt(); NetworkInstanceId netId = new NetworkInstanceId((uint)nwId); // NetworkMessages are not send to a specific player, but are received by the last // instantiated player. We need to find the player with the correct NetworkInstanceId // first and then let that player receive the message. GameObject nwObject = ClientScene.FindLocalObject(netId); if (nwObject != null) { HumanoidUnet humanoidUnet = nwObject.GetComponent <HumanoidUnet>(); humanoidUnet.ReceiveAvatarPose(msg, humanoidId); } else { if (debug <= HumanoidNetworking.Debug.Warning) { Debug.LogWarning(nwId + ": Could not find HumanoidNetworking object"); } } }
private void SetHumanoid(HumanoidUnet probe) { //HumanoidControl humanoid = FindObjectOfType<HumanoidControl>(); //probe.humanoid = humanoid; }