Ejemplo n.º 1
0
        protected override void Start()
        {
            type = TriggerType.PlayerFace;

            thisCollider = this.transform.GetComponent <Collider2D> ();
            facingObject = false;

            player = this.transform.GetComponentInParent <OW_PlayerController> ();
            events = this.transform.GetComponentInParent <GameEventHandler> ();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Move the player to the target destination
        /// </summary>
        /// <param name="other">Other.</param>
        IEnumerator Move(Collider2D other)
        {
            OW_PlayerController player = other.GetComponent <OW_PlayerController> ();

            if (fadeScreen != null && player != null)
            {
                yield return(StartCoroutine(fadeScreen.TeleportFadeIn(player, waitTime, fadeTime)));

                other.transform.position = new Vector2(targetX, targetY);
                yield return(StartCoroutine(fadeScreen.TeleportFadeOut(player, waitTime, fadeTime)));
            }
        }