- Home /
[SOLVED]Send a variable to an object type variable by using Stream
if(transform.Find("baseMale").animation.IsPlaying("basemeleeattack1"))
{
Debug.Log("animation playing");
stream.SendNext("test");//what should I send to target, target is an object variable
}
I'm working on Photon Unity Networking I want to send a variable to an object type variable by using stream and what should I send exactly I dont know I'm confused.
Here is the methods for sending and receiving data:
public void SendNext(object obj)
{
if (!this.write)
{
Debug.LogError("Error: you cannot write/send to this stream that you are reading!");
return;
}
this.data.Add(obj);
}
public object ReceiveNext()
{
if (this.write)
{
Debug.LogError("Error: you cannot read this stream that you are writing!");
return null;
}
object obj = this.data[this.currentItem];
Debug.Log(obj);//I'm watching the values
this.currentItem++;
return obj;
}
And here is some stream samples:
stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
stream.SendNext(rigidbody.velocity);
You can help me on this question there are the same problem.
Answer by iwaldrop · Jun 19, 2013 at 06:38 AM
In this case it looks like you might want to send parts of the AnimationState, like time, to interested parties. But, really, the animation controller should be clever enough to decide what to do based on the velocity and other states. There are a ton of good sources out there for photon unity networking.
Also, maybe you could clarify exactly what you are trying to accomplish here?
Your answer

Follow this Question
Related Questions
PhotonNetwork.Instantiate is not "buffered" 0 Answers
Photon Networking: LocalScale transform doesn't work 1 Answer
Unity networking tutorial? 6 Answers
Unity networking RPC problem- Photon 0 Answers