Exemple #1
0
 void Start()
 {
     this.transform.position = MotionUtility.Normalize(this.gameObject);
     this.transform.Rotate(0f, 180f, 0f);
     this.gameController = FindObjectOfType <GameController>();
     this.player         = FindObjectOfType <Player>();
 }
Exemple #2
0
    IEnumerator Move(float x, Func <float, bool> isValid, Func <float, bool> predicate, float rate)
    {
        isMoving = true;

        if (isValid(x))
        {
            while (predicate(x))
            {
                this.transform.position += new Vector3(rate, 0f, 0f);
                yield return(null);
            }
        }

        isMoving = false;
        this.transform.position = MotionUtility.Normalize(this.gameObject);
    }