/// <summary> /// 设置GAF Prefab /// </summary> /// <param name="g">The green component.</param> static void GAFMovieClipSetting(GAFMovieClip g) { if (false == g.isLoaded) { g.reload(); } g.settings.playAutomatically = false; g.settings.wrapMode = GAFInternal.Core.GAFWrapMode.Once; }
private void Movimento() { if (podeMover) { transform.localPosition = Vector3.MoveTowards(transform.localPosition, casas[indice].transform.localPosition, velocidade * Time.deltaTime); if (Vector3.Distance(transform.localPosition, casas[indice].transform.localPosition) <= 0.01f) { if (casas[indice].isPortal) { transform.localPosition = casas[indice + 1].transform.localPosition; indice += 2; return; } if (casas[indice].changeLevel) { sortingLayer++; paradoClip.settings.spriteLayerName = string.Format("Level{0}", sortingLayer); correndoClip.settings.spriteLayerName = string.Format("Level{0}", sortingLayer); vitoriaClip.settings.spriteLayerName = string.Format("Level{0}", sortingLayer); derrotaClip.settings.spriteLayerName = string.Format("Level{0}", sortingLayer); correndoClip.reload(); } if (casas[indice].newLevel) { if (gameCore.levelReached < casas[indice].level) { gameCore.levelReached = casas[indice].level; gameCore.animator.Play(string.Format("Nevoa_Level{0}", gameCore.levelReached.ToString())); } } if (casas[indice].flipSprite) { animationPile.transform.localScale = new Vector3(animationPile.transform.localScale.x * -1.0f, animationPile.transform.localScale.y, animationPile.transform.localScale.z); if (animationPile.transform.localScale.x > 0) { spritePivot.transform.localPosition = normal; } else { spritePivot.transform.localPosition = flip; } } if (indice + 1 == casas.Length) { //Chama fim TocaAnimacaoVitoria(); StartCoroutine(gameCore.ChamaFim(isPC, nome, jogadorIndice)); podeMover = false; fim = true; AudioPlayer.instance.StopLoopSFX(); } if (casasAndar > 0) { casasAndar--; indice++; } else { TocaAnimacaoParado(); if (casas[indice].valor == 0) { gameCore.ChamaCaiPedra(); } else { if (!fim) { //Chama próximo jogador StartCoroutine(gameCore.ProximoJogador()); podeMover = false; AudioPlayer.instance.StopLoopSFX(); } } } } } }