Exemplo n.º 1
0
    public void CompleteEatPlant()
    {
        var obj = Instantiate(this.pointGUIPrefab, transform.position, new Quaternion(0, 0, 0, 0))  as GameObject;
        GUIPointController score = obj.GetComponent <GUIPointController>();

        score.StartEffect(30, false);
    }
	void OnTriggerStay(Collider other)
	{
		if(this._player == null)
		{
			return;
		}





		switch(this.playerAction)
		{
			
		case EPlayerAction.NONE:
		{
			break;
		}
			
		case EPlayerAction.PLANT:
		{
			if(this._player.startPlant)
			{
				this._collider.enabled = false;
			}
			break;
		}
			
		case EPlayerAction.REBUKE:
		{
			if(this._player.startRebuke)
			{
				//this._collider.enabled = false;
				this._shadow.StartRebuke();
			}
			
			if(this._player.hasRebuked)
			{
				this._player.hasRebuked = false;
				this._shadow.StartRun();
				var obj = Instantiate(this.pointGUIPrefab, pointScore.position, new Quaternion(0,0,0,0))  as GameObject;
				GUIPointController score = obj.GetComponent<GUIPointController>();
				score.StartEffect(this.pointsToRebuke, true);
				
				Destroy(this.gameObject);
			}
			break;
		}
			
		}






		/*
		if (this._player.startPlant || this._player.startRebuke) {
			return;
		}

		if (other.tag != "Player") {
			return;
		}

		switch (this.playerAction) {
			
		case EPlayerAction.PLANT:
			{
				if (this._player.withObject) {
					this._player.canPlant = false;
				} else {
					this._player.canPlant = true;
				}

				break;
			}
			
		case EPlayerAction.REBUKE:
			{
				if (this._player.withObject) {
					this._player.canRebuke = false;
				} else {
					this._player.canRebuke = true;
				}
				break;
			}
		}
		
		if(this.playerAction == EPlayerAction.REBUKE)
		{
			if (!this.onlyFaceRight) {
				return;
			}
			
			if (onlyFaceRight && !this._player.facingRight) {
				this._player.canRebuke = false;
				return;
			} else if (onlyFaceRight && this._player.facingRight) {
				this._player.canRebuke = true;
			}
		}*/
	}
	public void CompletePlantation()
	{
		var obj = Instantiate(this.pointGUIPrefab, pointScore.position, new Quaternion(0,0,0,0))  as GameObject;
		GUIPointController score = obj.GetComponent<GUIPointController>();
		score.StartEffect(this.pointsToPlant, true);
	}