This file contains hidden or 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 UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
using System.Collections; | |
using System.Collections.Generic; | |
[RequireComponent(typeof(Image))] | |
[RequireComponent(typeof(Mask))] | |
[RequireComponent(typeof(ScrollRect))] | |
public class ScrollSnapRect : MonoBehaviour, IBeginDragHandler, IEndDragHandler, IDragHandler { |
This file contains hidden or 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
// You should change the center of this gameObject's mesh from default value (0,0,0). | |
// Because this script put its point to the contact point with the ground. | |
// And "use gravity" must be FALSE. | |
// Call HitTestWithRoad() from Update() | |
public var distance:float = 2.0; | |
public var smoothRatio:float = 0.2; | |
function HitTestWithRoad() { |
This file contains hidden or 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
namespace TanksMP | |
{ | |
public class OutOfBounds : PunBehaviour { | |
//Server only: check for players colliding with the out of bounds | |
void OnCollisionEnter(Collision col) | |
{ | |
if (!PhotonNetwork.isMasterClient) return; | |
//cache corresponding gameobject that was hit |