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
CGPoint currentOffset; | |
//Save the initial scrollview offset when adding floating view on the UIScrollView | |
currentOffset = scrollView.contentOffset; | |
- (void) scrollViewDidScroll:(UIScrollView *)scrollView{ | |
CGRect frame = self.floatingView.frame; | |
frame.origin.x -= (currentOffset.x - scrollView.contentOffset.x); | |
frame.origin.y -= (currentOffset.y - scrollView.contentOffset.y); |
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
- (void)viewDidLoad { | |
//add this on your viewDidLoad | |
UICollectionViewFlowLayout *flow = (UICollectionViewFlowLayout *)self.collectionViewLayout; | |
flow.sectionHeadersPinToVisibleBounds = YES; | |
} |
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
[{ | |
"category_name": "Birthday", | |
"slug": "birthday" | |
}, { | |
"category_name": "Good Luck", | |
"slug": "goodluck" | |
}] |
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
foreach (Touch touch in Input.touches) { | |
if( touch.phase == TouchPhase.Ended ){ | |
if(touch.tapCount == 1){ | |
Debug.Log("Tap"); | |
} | |
} | |
} |
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
using UnityEngine; | |
using System.Collections; | |
public class CameraShake : MonoBehaviour { | |
Camera cam; | |
public float shakeTime=0.2f; | |
float timeStop=0; | |
float shakeAmount=0.3f; | |
Vector3 originPosition; | |
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
Geek Honduras FAQ | |
¿Cual es el mejor proveedor de Internet? | |
Depende de la zona. | |
1.Claro | |
2.Cable Color | |
3.Amnet |
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
void turnAround(){ | |
Vector3 targetAngles = gameObject.transform.eulerAngles + 180f * Vector3.up; | |
gameObject.transform.eulerAngles = targetAngles; | |
} |
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
public IEnumerator PlayOneShot ( string paramName ) | |
{ | |
anim.SetBool( paramName, true ); | |
yield return new WaitForSeconds (anim.GetCurrentAnimatorStateInfo(0).length/2); | |
anim.SetBool( paramName, false ); | |
} | |
// Use this for initialization |
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
// sphere radius | |
float r= 5f; | |
Vector3 randomPosition = Random.onUnitSphere*r; | |
GameObject o = Instantiate(item, randomPosition, Quaternion.identity ) as GameObject; | |
Vector3 up = randomPosition; | |
Vector3 LookAt = Vector3.Cross(up, -transform.right) + up; | |
o.transform.LookAt(LookAt, up); |
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
if(Input.touchCount == 1){ | |
Touch touch = Input.GetTouch(0); | |
if(touch.phase == TouchPhase.Ended){ | |
handleTouch(touch.position); | |
} | |
} |