Exemple #1
0
    public override void Running(IFSMStateRunningMessage message)
    {
        var player = message.ConvertTo <RunningMessage>().Player;

        var dis     = player.transform.position - Mono.transform.position;
        var forward = dis.normalized;
        var man     = (int)dis.magnitude;

        if (man < 5)
        {
            forward *= -1;
        }
        else if (man == 5)
        {
            forward = Vector3.zero;
            Mono.gameObject.transform.Rotate(new Vector3(0, 400f * Time.deltaTime, 0));
        }


        Mono.transform.Translate(forward * Time.deltaTime * 10f, Space.World);
        //Mono.gameObject.transform.Rotate(new Vector3(0, 5f * Time.deltaTime, 0));
    }
 public abstract void Running(IFSMStateRunningMessage message);
 public override void Running(IFSMStateRunningMessage message)
 {
     CurState.Running(message);
 }
Exemple #4
0
 public override void Running(IFSMStateRunningMessage message)
 {
     // Debug.Log("Running PlayerIdleState");
 }
Exemple #5
0
 public override void Running(IFSMStateRunningMessage message)
 {
     Mono.gameObject.transform.Rotate(new Vector3(0, 400f * Time.deltaTime, 0));
 }