private IEnumerator initialize() { // Need to wait for camera to update fully before recreating buttons yield return(new WaitForEndOfFrame()); if (LevelBehavior.Current.CurrentBoard != null) { float ratio = Screen.width / (float)Screen.height; if (ratio >= 1.0f) { // Landscape Camera.main.orthographicSize = AMoPUtils.GetOrthoSizeForBoardSize(LevelBehavior.Current.CurrentBoard.BoardSize); } else { // Portrait Camera.main.orthographicSize = AMoPUtils.GetOrthoSizeForBoardSize(LevelBehavior.Current.CurrentBoard.BoardSize) / ratio; } float boardSize = LevelBehavior.Current.CurrentBoard.BoardSize; for (int i = 0; i < boardSize; i++) { for (int j = 0; j < boardSize; j++) { createButton(i, j); } } } }
private void HideShowNodes() { if (_editNodes == null) { return; } for (var x = 0; x < _boardData.BoardSize; x++) { for (var y = 0; y < _boardData.BoardSize; y++) { var row = AMoPUtils.GetEditNodeRow(_editNodes, x - _boardData.OffsetValue, y - _boardData.OffsetValue); if (row.Closest != null) { row.Closest.Show(); } foreach (var h in row.Hidden) { if (_sceneOrtho) { h.Hide(); } else { h.Fade(); } } } } }
protected override void OnNodeAffiliationChanged(BoardNodeAffiliation affiliation) { renderer.material.color = AMoPUtils.GetColorForAffiliation(affiliation); if (Hidden) { setAlpha(0); } }
private void ShowAllNodes() { for (var x = 0; x < _boardData.BoardSize; x++) { for (var y = 0; y < _boardData.BoardSize; y++) { var row = AMoPUtils.GetEditNodeRow(_editNodes, x - _boardData.OffsetValue, y - _boardData.OffsetValue); row.Closest.Show(); foreach (var h in row.Hidden) { h.Show(); } } } }
protected override void OnNodeAffiliationChanged(BoardNodeAffiliation affiliation) { ParticleSystem.ColorOverLifetimeModule color = particleSystem.colorOverLifetime; color.color = new ParticleSystem.MinMaxGradient(AMoPUtils.GetColorForAffiliation(affiliation)); }
public NodeRow GetOffsetNodeRow(float x, float y) { return(AMoPUtils.GetNodeRow(Nodes, x - OffsetValue, y - OffsetValue)); }
public NodeRow GetNodeRow(float x, float y) { return(AMoPUtils.GetNodeRow(Nodes, x, y)); }