Exemple #1
0
        public void Show()
        {
            gameObject.SetActive(true);

            IntVector2 targetPosition;
            Chuzzle    arrowChuzzle;

            GamefieldUtility.Tip(gamefield.Level.ActiveChuzzles, out targetPosition, out arrowChuzzle);

            fromFingerPosition = arrowChuzzle.Current.IntVector2Position;
            toFingerPosition   = targetPosition;

            var fromPosition = GamefieldUtility.ConvertXYToPosition((int)fromFingerPosition.x, (int)fromFingerPosition.y, Chuzzle.Scale);

            finger.transform.position = fromPosition;
            finger.Values["position"] = GamefieldUtility.ConvertXYToPosition((int)toFingerPosition.x, (int)toFingerPosition.y, Chuzzle.Scale);
            finger.Play();

            Tutorial.instance.targetCell      = gamefield.Level.GetCellAt(targetPosition);
            Tutorial.instance.takeableChuzzle = gamefield.Level.At(fromFingerPosition.x, fromFingerPosition.y);
            gamefield.TileDestroyed          += OnTileDestroyed;

            tutorialCloud.SetText("Drag to destroy");
            tutorialCloud.SetPosition(Camera.main.WorldToScreenPoint(fromPosition + Vector3.up * 0.5f));
            tutorialCloud.Show();
        }
Exemple #2
0
    void OnSpawned()
    {
        if (tk2dText == null)
        {
            tk2dText = GetComponent <tk2dTextMesh>();
        }
        if (tweenEvent == null)
        {
            tweenEvent = GetComponent <iTweenEvent>();
        }

        tweenEvent.Play();

        Invoke("Despawn", lifetime);
    }
Exemple #3
0
    void tweenfinish()
    {
        iTweenEvent it = (iTweenEvent)gameObject.GetComponent <iTweenEvent>();

        foreach (iTweenPath itp in it.paths)
        {
            Debug.Log(itp.pathName);
        }

        //跑完換路徑.
        if (it.Values.ContainsKey("path"))
        {
            if (it.Values["path"].GetType() == typeof(string))
            {
                it.Values["path"] = "New Path 1";
            }
        }

        it.Play();
        Debug.Log("tween finish!!");
    }
Exemple #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="target"></param>
 /// <param name="hash"></param>
 public WaitForAnimation(GameObject target, iTweenHashObject hash)
 {
     tweenEvent           = target.GetComponent <iTweenEvent>() ?? target.AddComponent <iTweenEvent>();
     tweenEvent.tweenHash = hash;
     tweenEvent.Play();
 }
Exemple #5
0
 private void StartNextPath()
 {
     actorTween.Values["path"] = actorPaths[m_nextPathIndex].pathName;
     actorTween.Play();
     m_nextPathIndex = (m_nextPathIndex + 1) % actorPaths.Length;
 }