You've already forked taptap2024_GJ_chidouren
init
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ac22eac33e47d5449d5b86b4d91c34f
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc4e6501cec44964ea149ac7656bcf9b
|
||||
folderAsset: yes
|
||||
timeCreated: 1435661090
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using HedgehogTeam.EasyTouch;
|
||||
|
||||
public class CubeSelect : MonoBehaviour {
|
||||
|
||||
private GameObject cube;
|
||||
|
||||
void OnEnable(){
|
||||
EasyTouch.On_SimpleTap += On_SimpleTap;
|
||||
}
|
||||
|
||||
void OnDestroy(){
|
||||
EasyTouch.On_SimpleTap -= On_SimpleTap;
|
||||
}
|
||||
|
||||
void Start(){
|
||||
cube= null;
|
||||
}
|
||||
|
||||
void On_SimpleTap (Gesture gesture){
|
||||
|
||||
if (gesture.pickedObject !=null && gesture.pickedObject.name=="Cube"){
|
||||
ResteColor();
|
||||
cube = gesture.pickedObject;
|
||||
cube.GetComponent<Renderer>().material.color = Color.red;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ResteColor(){
|
||||
if (cube!=null){
|
||||
cube.GetComponent<Renderer>().material.color = new Color(60f/255f,143f/255f,201f/255f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68d853e7dd8695b4a8079972e40963e6
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using HedgehogTeam.EasyTouch;
|
||||
|
||||
public class RTSCamera : MonoBehaviour {
|
||||
|
||||
private Vector3 delta;
|
||||
|
||||
void OnEnable(){
|
||||
EasyTouch.On_Swipe += On_Swipe;
|
||||
EasyTouch.On_Drag += On_Drag;
|
||||
EasyTouch.On_Twist += On_Twist;
|
||||
EasyTouch.On_Pinch += On_Pinch;
|
||||
}
|
||||
|
||||
|
||||
void On_Twist (Gesture gesture){
|
||||
|
||||
transform.Rotate( Vector3.up * gesture.twistAngle);
|
||||
}
|
||||
|
||||
void OnDestroy(){
|
||||
EasyTouch.On_Swipe -= On_Swipe;
|
||||
EasyTouch.On_Drag -= On_Drag;
|
||||
EasyTouch.On_Twist -= On_Twist;
|
||||
}
|
||||
|
||||
|
||||
void On_Drag (Gesture gesture){
|
||||
On_Swipe( gesture);
|
||||
}
|
||||
|
||||
void On_Swipe (Gesture gesture){
|
||||
|
||||
transform.Translate( Vector3.left * gesture.deltaPosition.x / Screen.width);
|
||||
transform.Translate( Vector3.back * gesture.deltaPosition.y / Screen.height);
|
||||
}
|
||||
|
||||
void On_Pinch (Gesture gesture){
|
||||
Camera.main.fieldOfView += gesture.deltaPinch * Time.deltaTime;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ada74f31ee49e34681124dbda740a5c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1cf9c78521d12f14d8690a557c4c1103
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95511c078470de147aa305315a4be8ee
|
||||
folderAsset: yes
|
||||
timeCreated: 1435661090
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class Ball : MonoBehaviour {
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ab70292744e9c9448bf89c713e8d90a
|
||||
timeCreated: 1456741077
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 200
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,82 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using HedgehogTeam.EasyTouch;
|
||||
|
||||
public class BallRunPlayer : MonoBehaviour {
|
||||
|
||||
public Transform ballModel;
|
||||
|
||||
private bool start =false;
|
||||
private Vector3 moveDirection;
|
||||
private CharacterController characterController;
|
||||
private Vector3 startPosition;
|
||||
private bool isJump = false;
|
||||
|
||||
void OnEnable(){
|
||||
EasyTouch.On_SwipeEnd += On_SwipeEnd;
|
||||
}
|
||||
|
||||
void OnDestroy(){
|
||||
EasyTouch.On_SwipeEnd -= On_SwipeEnd;
|
||||
}
|
||||
|
||||
void Start(){
|
||||
characterController = GetComponent<CharacterController>();
|
||||
startPosition = transform.position;
|
||||
|
||||
}
|
||||
|
||||
void Update () {
|
||||
|
||||
if (start){
|
||||
moveDirection = transform.TransformDirection(Vector3.forward)* 10f * Time.deltaTime;
|
||||
moveDirection.y -= 9.81f * Time.deltaTime;
|
||||
|
||||
if (isJump){
|
||||
moveDirection.y = 8f;
|
||||
isJump = false;
|
||||
}
|
||||
characterController.Move( moveDirection);
|
||||
ballModel.Rotate( Vector3.right * 400 * Time.deltaTime);
|
||||
}
|
||||
|
||||
if (transform.position.y<0.5){
|
||||
start=false;
|
||||
transform.position = startPosition;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCollision(){
|
||||
Debug.Log("ok");
|
||||
}
|
||||
|
||||
void On_SwipeEnd (Gesture gesture){
|
||||
|
||||
if (start){
|
||||
switch (gesture.swipe){
|
||||
case EasyTouch.SwipeDirection.DownLeft:
|
||||
case EasyTouch.SwipeDirection.UpLeft:
|
||||
case EasyTouch.SwipeDirection.Left:
|
||||
transform.Rotate(Vector3.up * -90);
|
||||
|
||||
break;
|
||||
case EasyTouch.SwipeDirection.DownRight:
|
||||
case EasyTouch.SwipeDirection.UpRight:
|
||||
case EasyTouch.SwipeDirection.Right:
|
||||
transform.Rotate(Vector3.up * 90);
|
||||
break;
|
||||
case EasyTouch.SwipeDirection.Up:
|
||||
if (characterController.isGrounded){
|
||||
isJump = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void StartGame(){
|
||||
start = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2c2690da05f1ee41b37fea93ee7fd77
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using HedgehogTeam.EasyTouch;
|
||||
|
||||
public class ThirdPersonCamera : MonoBehaviour
|
||||
{
|
||||
public float distanceAway; // distance from the back of the craft
|
||||
public float distanceUp; // distance above the craft
|
||||
public float smooth; // how smooth the camera movement is
|
||||
|
||||
private GameObject hovercraft; // to store the hovercraft
|
||||
private Vector3 targetPosition; // the position the camera is trying to be in
|
||||
|
||||
Transform follow;
|
||||
|
||||
void Start(){
|
||||
follow = GameObject.FindWithTag ("Player").transform;
|
||||
}
|
||||
|
||||
void LateUpdate ()
|
||||
{
|
||||
// setting the target position to be the correct offset from the hovercraft
|
||||
targetPosition = follow.position + Vector3.up * distanceUp - follow.forward * distanceAway;
|
||||
|
||||
// making a smooth transition between it's current position and the position it wants to be in
|
||||
transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * smooth);
|
||||
|
||||
// make sure the camera is looking the right way!
|
||||
transform.LookAt(follow);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d84d76fc294bc384d9ea022f75bf9fe1
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user