コード例 #1
0
ファイル: NetRef.cs プロジェクト: LSXAxeller/top-down-shooter
		/// <summary>
		/// Create an instance NetRef
		/// </summary>
		/// <param name="getter">The getter function for the variable</param>
		/// <param name="setter">The setter function for the variable</param>
		/// <param name="callback">The optional callback to be executed when the replication has complete</param>
		/// <param name="callbackCallers">The group of callers that will execute the callback method</param>
		public NetRef(Func<T> getter, Action<T> setter, Action callback, NetworkCallers callbackCallers, bool ignoreInterpolation = false, bool serverOnly = false)
		{
			this.getter = getter;
			this.setter = setter;
			this.callback = callback;
			this.IgnoreLerp = ignoreInterpolation;
			this.callbackCallers = callbackCallers;
			this.serverOnly = serverOnly;

			this.IsNumber = BeardedMath.IsNumber(getter());

			if (!this.IsNumber && !this.IgnoreLerp)
				this.IgnoreLerp = true;

			PreviousValue = getter();
		}
コード例 #2
0
			public NetSync(string method, NetworkCallers callers, Interpolate ignoreInterpolation)
			{
				this.method = method;
				this.callers = callers;
				interpolate = ignoreInterpolation;
			}
コード例 #3
0
			public NetSync(string method, NetworkCallers callers)
			{
				this.method = method;
				this.callers = callers;
				interpolate = Interpolate.True;
			}
コード例 #4
0
			public NetSync()
			{
				method = string.Empty;
				callers = NetworkCallers.Everyone;
				interpolate = Interpolate.True;
			}
コード例 #5
0
 public NetSync()
 {
     this.method = string.Empty;
     this.callers = NetworkCallers.Everyone;
     this.interpolate = Interpolate.True;
 }
コード例 #6
0
			public NetSync(string method, NetworkCallers callers)
			{
				this.method = method;
				this.callers = callers;
			}
コード例 #7
0
			public NetSync()
			{
				this.method = string.Empty;
				this.callers = NetworkCallers.Everyone;
			}