Esempio n. 1
0
 /// <summary>
 /// 意图-前往金币
 /// </summary>
 /// <param name="goldPosition"></param>
 public void SetIntentForGoToGold(Vector3 goldPosition)
 {
     SetBoatStatus(false);
     this.characterIntent = CharacterIntentEnum.GoToGold;
     aiForCharacterPath.SetDestination(goldPosition);
     characterAnim.SetCharacterRun();
     aiForCharacterPath.ChangeRadius(radiusForCharacter);
 }
Esempio n. 2
0
 /// <summary>
 /// 意图-闲置
 /// </summary>
 public void SetIntentForIdle()
 {
     this.characterIntent = CharacterIntentEnum.Idle;
     //停止移动
     aiForCharacterPath.StopMove();
     //设置角色动画状态
     characterAnim.SetCharacterStand();
     aiForCharacterPath.ChangeRadius(radiusForCharacter);
 }
Esempio n. 3
0
    /// <summary>
    /// 意图-离开岛屿
    /// </summary>
    public void SetIntentForExitIsland()
    {
        SetBoatStatus(false);
        this.characterIntent = CharacterIntentEnum.ExitIsland;
        Vector3 islandPosition = handler_Scene.GetExitIslandPosition(characterData.characterType);

        //islandPosition += new Vector3(Random.Range(-3f, 3f), 0, 0);
        aiForCharacterPath.SetDestination(islandPosition + new Vector3(Random.Range(-1, 1), 0, Random.Range(-1, 1)));
        aiForCharacterPath.ChangeRadius(radiusForCharacter);
    }
Esempio n. 4
0
    /// <summary>
    /// 意图-返回舰队
    /// </summary>
    public void SetIntentForBack()
    {
        SetBoatStatus(true);
        this.characterIntent = CharacterIntentEnum.Back;
        Vector3 startPosition = handler_Scene.GetStartPosition(characterData.characterType);

        aiForCharacterPath.SetDestination(startPosition + new Vector3(Random.Range(-1, 1), 0, Random.Range(-1, 1)));
        //将金币放在船上
        if (handGold != null)
        {
            handGold.transform.position = transform_BoatPosition.transform.position;
        }
        characterAnim.SetCharacterRow();
        aiForCharacterPath.ChangeRadius(radiusForBoat);
    }
Esempio n. 5
0
 /// <summary>
 /// 意图-搜索金币
 /// </summary>
 public void SetIntentForSearch()
 {
     if (targetGold != null)
     {
         targetGold = null;
     }
     SetBoatStatus(false);
     this.characterIntent = CharacterIntentEnum.Search;
     targetGold           = handler_Gold.GetTargetGold(transform.position);
     if (targetGold)
     {
         targetGold.AddObserver(this);
         SetIntentForGoToGold(targetGold.transform.position);
     }
     else
     {
         //没有金币就离开
         SetIntentForExitIsland();
     }
     aiForCharacterPath.ChangeRadius(radiusForCharacter);
 }