protected override void OnReceive(MultiValue values) { SetId(values.Pop().value); SetIconUrl(values.Pop().value); SetMessage(values.Pop().value); scoreUi.text = values.Pop().value; }
protected override void OnReceive(MultiValue values) { if (isPositionSync) { syncStartPos_ = transform.position; syncEndPos_ = values.Pop().value.AsVector3(); if (isFirst_) { transform.position = syncEndPos_; } } if (isRotationSync) { syncStartRot_ = transform.rotation; syncEndRot_ = values.Pop().value.AsQuaternion(); if (isFirst_) { transform.rotation = syncEndRot_; } } if (isScaleSync) { syncStartScale_ = transform.localScale; syncEndScale_ = values.Pop().value.AsVector3(); if (isFirst_) { transform.localScale = syncEndScale_; } } syncStartTime_ = Time.time; syncEndTime_ = syncStartTime_ + sendCycle; if (isFirst_) { isFirst_ = false; } }
protected override void OnReceive(MultiValue data) { while (data.values.Count > 0) { var name = data.Pop().value; var param = data.Pop(); switch (param.type) { case "bool": animator.SetBool(name, param.value.AsBool()); break; case "int": animator.SetInteger(name, param.value.AsInt()); break; case "float": animator.SetFloat(name, param.value.AsFloat()); break; } } }