void Start ()
	{
		//_jumpingArrowInstant = ( GameObject ) Instantiate ( _jumpingArrowPrefab, transform.position + Vector3.forward * ( arrowFromAbove ? 1.0f : -0.9f ) * 2f + Vector3.up * 2f, Quaternion.identity );
		//_jumpingArrowInstant.GetComponent < JumpingUIElement > ().typeFromAbove = arrowFromAbove;
		//_jumpingArrowInstant.transform.parent = transform;
		//_jumpingArrowInstant.transform.localScale *= 2f;

		_mySelectedcomponent = GetComponent < SelectedComponenent > ();
		if ( _mySelectedcomponent ) _mySelectedcomponent.setSelectedForTutorial ( true, true, true, true, false );
	}
Exemplo n.º 2
0
	//=======================Daves Work======================

	//*************************************************************//	
	void Start () 
	{
		myParticles = (GameObject)Resources.Load ("Particles/elecSparks");
		_myHandleEnemySelected = handleAttackedByCharacted;
		_handleAttackExecuted = handleAttackedButtonPressed;
		_myIComponent = gameObject.GetComponent < IComponent > ();
		_mySelectedComponent = gameObject.GetComponent < SelectedComponenent > ();
		myParticlesInstance = (GameObject)Instantiate (myParticles, transform.position, transform.rotation);
		//myParticles.transform.eulerAngles = new Vector3 (transform.eulerAngles.x, -transform.eulerAngles.y, transform.eulerAngles.z);
		myParticlesInstance.SetActive(false);
		
		_lookRightLocalScale = transform.localScale.x;
	}
	void Start ()
	{
		if ( ! dontShowArrow )
		{
			_jumpingArrowInstant = ( GameObject ) Instantiate ( _jumpingArrowPrefab, transform.position + Vector3.forward * ( arrowFromAbove ? 0.9f + moveUp : -0.9f + moveUp ) * TutorialsManager.getInstance ().getCurrentTutorialStep ().arrowBigFactor + Vector3.up, Quaternion.identity );
			_jumpingArrowInstant.GetComponent < JumpingUIElement > ().typeFromAbove = arrowFromAbove;
			_jumpingArrowInstant.transform.parent = transform;
			_jumpingArrowInstant.transform.localScale *= TutorialsManager.getInstance ().getCurrentTutorialStep ().arrowBigFactor;
		}

		_mySelectedcomponent = GetComponent < SelectedComponenent > ();
		if ( _mySelectedcomponent ) _mySelectedcomponent.setSelectedForTutorial ( true, true, true, true, false );
		else
		{
			_mySelectedcomponent = gameObject.AddComponent < SelectedComponenent > ();
			_mySelectedcomponent.setSelectedForTutorial ( true, true, true, true, false );
		}
	}
Exemplo n.º 4
0
	void Start () 
	{
		_myHandleEnemySelected = handleAttackedByCharacted;
		_handleAttackExecuted = handleAttackedButtonPressed;
		_myIComponent = gameObject.GetComponent < IComponent > ();
		_mySelectedComponent = gameObject.GetComponent < SelectedComponenent > ();
		if(_myIComponent.myID == GameElements.ENEM_TENTACLEDRAINER_01 || _myIComponent.myID == GameElements.ENEM_TENTACLEDRAINER_02)
		{
			myParticlesInstance = (GameObject)Instantiate (myParticles, transform.position, transform.rotation);
			//myParticles.transform.eulerAngles = new Vector3 (transform.eulerAngles.x, -transform.eulerAngles.y, transform.eulerAngles.z);
			myParticlesInstance.SetActive(false);
		}
		_lookRightLocalScale = transform.localScale.x;
		//=======================Daves Work======================
		myTargets = new List<GameObject> ();
		foreach(GameObject character in GameObject.FindGameObjectsWithTag("Character"))
		{
			myTargets.Add(character);
		}
	}
	void Start ()
	{
		_myTutorialStep = TutorialsManager.getInstance ().getCurrentTutorialStep ();
		bool createJumpingArrow = true;
		switch ( _myTutorialStep.type )
		{
			case TutorialsManager.TUTORIAL_OBJECT_TYPE_TAP_ATTACK_BUTTON:
				createJumpingArrow = false;
				break;
		}
		
		if ( createJumpingArrow )
		{
			if ( _myTutorialStep.highLightWithHand )
			{
				_tutorialHandInstant = ( GameObject ) Instantiate ( _tutorialHandPrefab, transform.position + Vector3.up + Vector3.back *  _myTutorialStep.handMove, _tutorialHandPrefab.transform.rotation );
				_tutorialHandInstant.transform.parent = transform.parent;
				_tutorialHandInstant.AddComponent < SimulateTapControl > ().scale = VectorTools.cloneVector3 ( _tutorialHandInstant.transform.localScale );

				_tileMarkInstant = ( GameObject ) Instantiate ( _tileMarkPrefab, transform.parent.position + Vector3.down * 0.25f + Vector3.forward * 0.5f, _tileMarkPrefab.transform.rotation );
				SelectedComponenent currentSelectedComponenent = _tileMarkInstant.AddComponent < SelectedComponenent > ();
				currentSelectedComponenent.setSelectedForPulsingCharacterMark ( true, 1.5f );
			}
			else
			{
				_jumpingArrowInstant = ( GameObject ) Instantiate ( _jumpingArrowPrefab, transform.position + Vector3.forward * ( arrowFromAbove ? 2.3f : -1f ) * TutorialsManager.getInstance ().getCurrentTutorialStep ().arrowBigFactor + Vector3.up, Quaternion.identity );
				_jumpingArrowInstant.GetComponent < JumpingUIElement > ().typeFromAbove = arrowFromAbove;
				_jumpingArrowInstant.transform.parent = transform;
				_jumpingArrowInstant.transform.localScale *= TutorialsManager.getInstance ().getCurrentTutorialStep ().arrowBigFactor;
			}
		}

		TutorialsManager.getInstance ().objectToBeDestoryedOnNextStep = _jumpingArrowInstant;
		
		_mySelectedcomponent = GetComponent < SelectedComponenent > ();
		if ( _mySelectedcomponent ) _mySelectedcomponent.setSelectedForTutorial ( true, true, true, true, false );
	}
	//*************************************************************//
	public void setSelected ( bool isOn, bool force = false, bool withAlphaFade = true, bool permanent = false )
	{
		if (( ! force ) && ( _iAmSelected == isOn )) return;

		_iAmSelectedPermanently = permanent;
		_withAlphaFade = withAlphaFade;
		_iAmSelected = isOn;
		_countPoping = 0;
		
		if ( isOn )
		{
			CURRENT_SELECTED_OBJECT = this;
			SoundManager.getInstance ().playSound ( SoundManager.OBJECT_SELECT );
			if ( _myMaterial != null ) _myMaterial.shader = Shader.Find ( "Transparent/Diffuse" );	
			onCompleteTweenAnimationDown ();
		}
		else
		{
			if ( _goParent ) iTween.Stop ( this.transform.parent.gameObject );
			else iTween.Stop ( this.gameObject );
			
			if ( _goParent ) transform.parent.localScale = VectorTools.cloneVector3 ( _initialScale );
			else transform.localScale = VectorTools.cloneVector3 ( _initialScale );

			if ( _myMaterial != null ) _myMaterial.shader = Shader.Find ( "Unlit/Transparent" );
//===============================Daves Edit==============================
			Invoke ("stopTween",1.43f);
		}
	}