Pan.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( ) : void
Результат void
	void Update() 
	{

		//Debug.Log (Spawner.panning);
		if (Spawner.panning && Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved)
		{
			Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
			if (touchDeltaPosition.x > -300f && touchDeltaPosition.x < 250f) 
			transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0);
		}
	}
}

Usage Example

Пример #1
0
        /// <summary>
        /// Resets the unput, is called on LateUpdate
        /// </summary>
        public void Reset()
        {
            foreach (Key k in Keys.Values)
            {
                k.Update();
            }

            Swipe.Update();
            Pan.Update();
        }