Ejemplo n.º 1
0
 public override void ResetData()
 {
     StopAllCoroutines();
     animHandler.ResetParam();
     moveHandler.SetDestination(homePlace, homePlace);
     waypointQueue.Clear();
     SetPlace(homePlace);
     currentState = EState.Prepare;
     PrepareAtHome();
 }
Ejemplo n.º 2
0
    void SetNextPlace()
    {
        CurrentPlace = Util.RoundToVectorInt((Vector2)transform.position);
        Vector2Int nextPlace = CurrentPlace;

        if (reservDir != Direction.Empty && CheckDirectionPlace(reservDir, ref nextPlace))
        {
            CurrentDir = reservDir;
            reservDir  = Direction.Empty;
            moveHandler.SetDestination(CurrentPlace, nextPlace);
            animHandler.SetDirection(CurrentDir);
        }
        else if (CurrentDir != Direction.Empty && CheckDirectionPlace(CurrentDir, ref nextPlace))
        {
            moveHandler.SetDestination(CurrentPlace, nextPlace);
        }
        else
        {
            CurrentDir = Direction.Empty;
            reservDir  = Direction.Empty;
            //animHandler.StopAnimation();
        }
    }
Ejemplo n.º 3
0
    public void Init(Vector2Int homePlace, Vector2Int stageMin, Vector2Int stageMax, Ghost partner = null)
    {
        moveHandler = GetComponent <MoveHandler>();
        animHandler = GetComponent <GhostAnimationHandler>();
        moveHandler.Init(moveSpeed, SetNextPlace);
        moveHandler.SetDestination(homePlace, homePlace);

        this.partner   = partner;
        this.homePlace = homePlace;
        this.stageMin  = stageMin;
        this.stageMax  = stageMax;
        currentState   = EState.Prepare;

        SetPlace(homePlace);
        PrepareAtHome();
    }