Exemple #1
0
    public virtual void Enter()
    {
        SetStartMovementListener(OnMoveStarted);
        SimplePathData startPath = GetRandomStartPath();

        startPath = NormalizePath(startPath);
        this.transform.position = startPath.start;
        AddToPath(startPath.end, data.speed);
        SetFinishedListener(OnEntered);

        this.gameObject.SetActive(true);
    }
Exemple #2
0
    public override void Enter()
    {
        SetStartMovementListener(OnMoveStarted);
        SetState(State.ENTERING);

        SimplePathData startPath = GetRandomStartPath();
        Vector3        point1    = NormalizeVector(startPath.start);
        Vector3        point2    = NormalizeVector(startPath.end);

        this.gameObject.transform.position = point1;
        BounceToPosition(point2);

        SetFinishedListener(OnEntered);

        if (!gameObject.activeSelf)
        {
            gameObject.SetActive(true);
        }
    }
Exemple #3
0
 protected SimplePathData NormalizePath(SimplePathData path)
 {
     path.start = NormalizeVector(path.start);
     path.end   = NormalizeVector(path.end);
     return(path);
 }