Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved layer manager functionality into LayerManager class.
- Loading branch information
Showing
17 changed files
with
391 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,53 @@ | |||
/* | |||
* @author Valentin Simonov / http://va.lent.in/ | |||
*/ | |||
|
|||
using System; | |||
using System.Collections.Generic; | |||
using TouchScript.Hit; | |||
using TouchScript.Layers; | |||
using TouchScript.Pointers; | |||
|
|||
namespace TouchScript | |||
{ | |||
public interface ILayerManager | |||
{ | |||
/// <summary> | |||
/// Gets the list of <see cref="TouchLayer"/>. | |||
/// </summary> | |||
/// <value>A sorted list of currently active layers.</value> | |||
IList<TouchLayer> Layers { get; } | |||
|
|||
int LayerCount { get; } | |||
|
|||
/// <summary> | |||
/// Adds a layer in a specific position. | |||
/// </summary> | |||
/// <param name="layer">The layer to add.</param> | |||
/// <param name="index">Layer index to add the layer to or <c>-1</c> to add to the end of the list.</param> | |||
/// <param name="addIfExists">if set to <c>true</c> move the layer to another index if it is already added; don't move otherwise.</param> | |||
/// <returns> | |||
/// True if the layer was added. | |||
/// </returns> | |||
bool AddLayer(TouchLayer layer, int index = -1, bool addIfExists = true); | |||
|
|||
/// <summary> | |||
/// Removes a layer. | |||
/// </summary> | |||
/// <param name="layer">The layer to remove.</param> | |||
/// <returns>True if the layer was removed.</returns> | |||
bool RemoveLayer(TouchLayer layer); | |||
|
|||
/// <summary> | |||
/// Swaps layers. | |||
/// </summary> | |||
/// <param name="at">Layer index 1.</param> | |||
/// <param name="to">Layer index 2.</param> | |||
void ChangeLayerIndex(int at, int to); | |||
|
|||
void ForEach(Func<TouchLayer, bool> action); | |||
|
|||
bool GetHitTarget(IPointer pointer, out HitData hit); | |||
|
|||
} | |||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,16 @@ | |||
/* | |||
* @author Valentin Simonov / http://va.lent.in/ | |||
*/ | |||
|
|||
using UnityEngine; | |||
|
|||
namespace TouchScript | |||
{ | |||
public sealed class LayerManager : MonoBehaviour | |||
{ | |||
public static ILayerManager Instance | |||
{ | |||
get { return LayerManagerInstance.Instance; } | |||
} | |||
} | |||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.