IEnumerator LoadPuzzleSelectMenu(GameObject puzzleGamePanel, Animator puzzleGamePanelAnim) {
     puzzleLevelSelectPanel.SetActive(true);
     puzzleGamePanelAnim.Play("Slidein");
     puzzleGamePanelAnim.Play("Slideout");
     yield return new WaitForSeconds(1f);
     puzzleGamePanel.SetActive(false);
 }
Example #2
0
	void Movement()
	{
		var bit = GameObject.Find("Bit");
		anim = gameObject.GetComponent<Animator> ();

		if(Input.GetKey (KeyCode.D)) {
			bit.transform.Translate (Vector2.right * speed * (Time.deltaTime));
			anim.Play ("Bit_WalkRight");

		}

		if (Input.GetKey (KeyCode.A)) {
			bit.transform.Translate (-Vector2.right * speed * (Time.deltaTime));
			anim.Play ("Bit_WalkLeft");	
		}

		if (Input.GetKey (KeyCode.W)) {
			bit.transform.Translate (Vector2.up * speed * (Time.deltaTime));
			anim.Play ("Bit_WalkUp");
		}

		if (Input.GetKey (KeyCode.S)) {
			bit.transform.Translate (Vector2.down * speed * (Time.deltaTime));
			anim.Play ("Bit_WalkDown");
		}
	}
    // Use this for initialization
    void Start()
    {
        isHit = false;

        animator = GetComponent<Animator>();
        //animator.StartPlayback();

        animator.SetBool("IsIdle", startIdle);

        isWalking = !startIdle;
        if(startIdle)
        {
            animator.Play("SpiderIdle", -1, 1f);
        }
        else
        {
            animator.Play("SpiderWalk", -1, 1f);
        }

        startPoint = transform.position;
        endPoint = new Vector3(transform.position.x + (startTowardsLeft ? -distanceToTravel: distanceToTravel) / 72f, transform.position.y, transform.position.z);

        totalDistanceTravelled = 0f;

        if(startTowardsLeft)
        {
            transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
            Vector3 tmp = endPoint;
            endPoint = startPoint;
            startPoint = tmp;
            startTowardsLeft = !startTowardsLeft;
        }
        Debug.Log(startPoint.ToString() + " " + endPoint.ToString());
    }
Example #4
0
 void Start()
 {
     anim = GetComponent<Animator>();
     if(PlayerPrefs.GetString("escaleraOpen") == "closed"){
         anim.Play ("escaleraClosed");
     }else{
         anim.Play ("escaleraOpened");
         HabilitarSubida();
         this.collider2D.enabled = false;
     }
     //PlayerPrefs.SetString("playerInstance","SwampHouse3");
     animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
     playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
 }
Example #5
0
 void Start()
 {
     playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
     animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
     gui = (Gui)GameObject.FindObjectOfType(typeof(Gui));
     inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory));
     anim = GetComponent<Animator>();
     if(PlayerPrefs.GetInt("doorInOpen") == 0){
         anim.Play("doorInClosed");
     }else{
         this.collider2D.enabled = false;
         this.gameObject.tag = "Untagged";
         anim.Play("doorInOpened");
     }
 }
Example #6
0
    public void Init(PowerupManager.types type)
    {
        if(Data.Instance.musicManager.volume==1)
            Events.OnMusicVolumeChanged(0.2f);
        anim = GetComponent<Animator>();
        anim.updateMode = AnimatorUpdateMode.UnscaledTime;
        Invoke("onComplete", 0.1f);

        anim.Play("powerupSign", 0, 0);

        switch (type)
        {
            case PowerupManager.types.CHUMBO:
                title.text = "MEGA-CHUMBO";
                desc.text = "TREMENDO CHUMBO + 1 AGUANTE";
                break;
            case PowerupManager.types.GIL:
                title.text = "GIL-POWA";
                desc.text = "PODER DE EXTRA PUNGUEO + 1 AGUANTE";
                break;
            case PowerupManager.types.MOTO:
                title.text = "RATI-CICLO";
                desc.text = "APLASTA COBANIS Y CIVILES + 1 AGUANTE";
                break;
        }
        Time.timeScale = 0.05f;
    }
Example #7
0
 public void CollectRing()
 {
     _animator = GetComponent<Animator>();
     _animator.Play("Ring_Hit");
     if (!_collected) { GetComponent<AudioSource>().Play(); }
     _collected = true;
 }
Example #8
0
    void Start()
    {
        toggles = GameObject.Find("TowerChoice").GetComponentsInChildren<Toggle>();
        choiceTowers = new Dictionary<TglTower, Tower>();
        retrieveChoiceTowers();
        DisableChoices();

        title = GameObject.Find("txtTitle");
		title.SetActive(false);
        smallTitle = GameObject.Find("txtSmallTitle");
        tiltShift = GameObject.Find("Main Camera").GetComponent<UnityStandardAssets.ImageEffects.TiltShift>();
        spawnLaps = 2;
        spawner = GameObject.Find("Spawn").GetComponentInChildren<Spawn>();
		step = Step.STARTING;
        shakeAmount = 0.1F;
        shakeTimer = 1F;

        HideTowerDetails();
        
        btnNextWave.onClick.AddListener(EndConstructionTime);
        nextWave = GameObject.Find("btnNextWave");
        nextWave.SetActive(false);

		animator = ((Animator)GetComponent<Animator>());
		topCam = (Camera) topCamObject.GetComponent<Camera> ();

		animator.Play("CameraStartAnim", -1, 0F);
		startTimer = Time.time;
    }
 // Use this for initialization
 void Start()
 {
     eating = true;
     pacman = GameObject.Find("pacman");
     Laika = GetComponent<Animator>();
     Laika.Play("Eating");
 }
Example #10
0
 void Start()
 {
     anim = GetComponent<Animator>();
     animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
     playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
     anim.Play("ramasIdle");
 }
 public void Activate(panelState state)
 {
     anim = gameObject.GetComponent<Animator>();
     gameObject.SetActive(true);
     currentState = state;
     anim.Play("PopupOpen");
 }
Example #12
0
 // Use this for initialization
 void Start()
 {
     //swordEdge = GetComponent<Ray> ();
     pos = GetComponent<Transform> ();
     anim = GetComponent<Animator> ();
     anim.Play ("idle");
 }
Example #13
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent<Animator>();

        animator.Play("DayNight", -1, Game.CurrentTime / 24f);
        animator.speed = 0f;
    }
	/*=========================== Methods ===================================================*/

	/*=========================== Start() ===================================================*/

	void Start () {
	
		// get reference to DefenceTower object
		defenceTower = gameObject.GetComponentInParent<DefenceTower> ().defenceTower;

		// set the projectile speed
		projectileSpeed = defenceTower.GetComponent<DefenceTower>().projectileSpeed;

		// set projectile damage
		projectileDamage = defenceTower.GetComponent<DefenceTower>().projectileDamage;

		// get the reference to the target enemy
		target = defenceTower.GetComponent<DefenceTower> ().enemyTarget;

		// set animation to not finished
		animationFinished = false;

		// get reference to animator
		anim = GetComponent<Animator>();

		if (defenceTower.tag == "TowerLvl4") {

			// run animation Projectile gets bigger
			anim.Play("ProjectileGetsBigger", 0, 0f);

		} else { // if not lvl 4 tower

			// animation does not play
			animationFinished = true;

		} // if

	} // Start()
Example #15
0
 public void ClickToLogin()
 {
     animator = GameObject.Find("/Login").GetComponent<Animator>();
     hint.text = "";
     ar.pushToList("CloseRegister");
     animator.Play("CloseRegister");
 }
Example #16
0
	// Use this for initialization
	void Start () {
    controller = GetComponent<CharacterController>();

    // Animation.
    animator = GetComponent<Animator>();
    animator.Play("Idle");
	}
Example #17
0
 void Start()
 {
     anim = GetComponent<Animator>();
     anim.Play("capulloWait");
     ballSpawn = this.transform.FindChild("ballSpawn").gameObject;
     gui = (Gui)GameObject.FindObjectOfType(typeof(Gui));
     inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory));
 }
 public IEnumerator PlayAnimation(string AnimationName)
 {
     Debug.Log ("PlayAnimation(): " + AnimationName);
     Anim = gameObject.GetComponent<Animator>();
     Anim.Play(AnimationName,0,0);
     yield return new WaitForSeconds(1.65f) ;
     Anim.StopPlayback();
 }
 public void MecanimEnterWater()
 {
     useMecanim = GetComponent<AttackTriggerC>().useMecanim;
     animator = GetComponent<PlayerMecanimAnimationC>().animator;
     animator.SetBool(jumpState , false);
     animator.SetBool("swimming" , true);
     animator.Play(swimIdle.name);
 }
Example #20
0
 void Start()
 {
     camera = GameObject.Find ("Capsule").transform;
     animator = transform.GetComponent<Animator>();
     isStill = true;
     animator.Play("Spawn");
     StartCoroutine (Fly ());
 }
Example #21
0
 void start()
 {
     controls.gameObject.SetActive (false);
     levelSelect.gameObject.SetActive (false);
     animPlay = controlButton.GetComponent<Animator> ();
     animPlay.enabled=true;
     animPlay.Play("ControlButtonAnimation");
 }
    // Use this for initialization
    void Start()
    {
        _motor = GetComponent<PlatformerMotor2D>();
            _animator = visualChild.GetComponent<Animator>();
            _animator.Play("Idle");

            _motor.onJump += SetCurrentFacingLeft;
    }
	// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
	override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        _fTimer += Time.deltaTime;
        if (_fTimer >= _fMovingTime)
        {
            animator.Play("RockManBattleIdle");
        }
    }
Example #24
0
 public void OnAttack(ItemProperty itemProperty)
 {
     _playerBase.GetComponent<Animator>().Play("attack");
     _actorBase = GetComponent<ActorBase> ();
     _animator = _actorBase.GetComponent<Animator>();
     _animator.Play("attack");
     attack (itemProperty);
 }
 void Start()
 {
     ghostPoints = GameObject.FindGameObjectsWithTag("point");
     pacman = GameObject.Find ("pacman");
     InvokeRepeating ("StumbleAround", 1, 6);
     ghostani = GetComponent<Animator>();
     ghostani.Play("Run");
     //OS = FindObjectOfType<>;
 }
	void Start () {
        state = STATE_RUN;
        speed = Random.Range(4f, 6f); 
        type = Random.Range(1, 9);
        anim = AnimObject.GetComponent<Animator>();
        anim.Play("CAR_ANIM_" + type.ToString());
        
        
	}
Example #27
0
 void Start()
 {
     anim = GetComponent<Animator>();
     clipHash = Animator.StringToHash(clipName);
     anim.Play(clipHash, 0, startFrame);
     clipLength = anim.GetCurrentAnimatorStateInfo(0).length;
     t = startFrame * clipLength;
     anim.speed = 0;
 }
Example #28
0
 public override void OnStateUpdate(Animator anim, AnimatorStateInfo animInfo, int layerIndex)
 {
     player = anim.transform.parent.GetComponent<Rigidbody2D>();
     animTime = animInfo.normalizedTime;
     if (player.velocity.x > 0)
     {
         anim.Play("Jump AnimationR", 0, animTime);
     }
 }
Example #29
0
 void Start()
 {
     animations = (Animations)GameObject.FindObjectOfType(typeof(Animations));
     gui = (Gui)GameObject.FindObjectOfType(typeof(Gui));
     inventory = (Inventory)GameObject.FindObjectOfType(typeof(Inventory));
     playerMove = (PlayerMove)GameObject.FindObjectOfType(typeof(PlayerMove));
     anim = GetComponent<Animator>();
     anim.Play("doorBathClosed");
 }
Example #30
0
	// Use this for initialization
	void Start () {
        player = GameObject.Find("Player1");
        currentTarget = getNewPosition();

        rigidBody = gameObject.GetComponent<Rigidbody>();
        animator = gameObject.GetComponent<Animator>();

        animator.Play(enums.WolfAnimations.Wolf_Idle.ToString());
    }