Esempio n. 1
0
	// Use this for initialization
	void Start () 
	{
	
		Instance = this;
		roadO = GameObject.FindGameObjectWithTag("MainCamera");
		roadScript = roadO.GetComponent<ForegroundScript>();
		startPosition = new Vector3(30,getStartPosition(),-1);
		this.transform.position = startPosition;
		startTime = (float)Random.Range(0.0f,10.0f);

		currentSpeed = 0.0f;
		fastSpeed = 6.0f;
		slowSpeed = 4.0f;
	
		rotSpeed = 0.01f;
		rotPosition = 0.0f;
		
	}
Esempio n. 2
0
	public void OnTriggerStay(Collider other)
    { 
		
		//Mean Cloudci
        if (other.gameObject.tag == "cloud") 
		{ 
			
			if(cloudScript.currentLane == currentLane)
			{
			
				//Reduce Time
				//Reset Multiply		
				//Add Stumble
				other.gameObject.transform.position = new Vector3 ( -30,0,-1);
			}
		}
		
		//Gold Coin
		else if (other.gameObject.tag == "goldCoin")
		{ 
			coinScript = other.gameObject.GetComponent<GoldCoin>();
			if(coinScript.currentLane == currentLane)
			{
				other.transform.position = new Vector3(-30, other.transform.position.y, other.transform.position.z);
			}
        }
		
		//Empty Kettle
		else if (other.gameObject.tag == "kettleEmpty")
		{ 
			
			if( emptyKScript.currentLane == currentLane)
        	{
					//
			//Reset Multiply
			//Add Stumbles
			other.gameObject.transform.position = new Vector3 ( -30,0,-1);
        
			}
		}
		
		//Full Kettle
		else if (other.gameObject.tag == "kettleFull")
		{ 
			
			if( fullKScript.currentLane == currentLane)
        	{
			
			//Reset Multiply
			//Add Stumbles
			other.gameObject.transform.position = new Vector3 ( -30,0,-1);
        	}
		}
		
		//Add Time
		else if (other.gameObject.tag == "timeClock")
		{ 
			
			if(clockScript.currentLane == currentLane)
        	{
			//Add Time
			//AddTime(10);
			other.gameObject.transform.position = new Vector3 ( -30,0,-1);
		
			}
		}
		//Multiplyer up
		else if (other.gameObject.tag == "Shamrock" )
		{
			
			if(shamScript.currentLane == currentLane)
        	{
            //Up Multiplyer
			other.gameObject.transform.position = new Vector3(-30,0,-1);
        	}
		}
		
		
	}