コード例 #1
0
ファイル: BroadcastSentence.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     Sentence sentence = (Sentence) tree.GetFromBlackboard<Sentence>(sentenceKey);
     if(sentence != null){
         tree.actions.BroadcastSentence(sentence, range);
         parent.ReceiveStatus(Status.Success);
     }
     else{
         parent.ReceiveStatus(Status.Failure);
     }
 }
コード例 #2
0
ファイル: CheckInRange.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);

        GameObject target = tree.GetFromBlackboard<GameObject>(targetKey);
        if(target != null && tree.actions.IsInRange(target, range)){
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #3
0
ファイル: CopyToNewKey.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);

        object obj = tree.GetFromBlackboard<object>(key);
        if(obj != null){
            tree.AddToBlackboard(copyKey, obj);
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #4
0
ファイル: SetEmptyRoom.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);
        GameObject room = tree.actions.GetEmptyRoom();

        if(room != null){
            tree.AddToBlackboard(emptyRoomKey, room);
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #5
0
ファイル: DisplaySentence.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     if(sentence == null){
         sentence = (Sentence) tree.GetFromBlackboard<Sentence>(sentenceKey);
     }
     if(sentence != null){
         tree.actions.DisplaySentence(sentence, seconds);
         parent.ReceiveStatus(Status.Success);
     }
     else{
         parent.ReceiveStatus(Status.Failure);
     }
 }
コード例 #6
0
ファイル: ConstructSentence.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);

        GameObject noun1 = tree.GetFromBlackboard<GameObject>(noun1Key);
        GameObject noun2 = tree.GetFromBlackboard<GameObject>(noun2Key);

        if(noun1 != null && noun2 != null){
            tree.AddToBlackboard(sentenceKey, new Sentence(noun1, verb, noun2));
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #7
0
ファイル: SetPoint.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     GameObject target = tree.GetFromBlackboard<GameObject>(targetKey);
     if(target != null){
         ///Debug.Log("targetPoint");
         //Debug.Log (target);
         //Debug.Log (target.transform.position);
         tree.AddToBlackboard(destinationKey, target.transform.position);
         parent.ReceiveStatus(Status.Success);
     }
     else{
         parent.ReceiveStatus(Status.Failure);
     }
 }
コード例 #8
0
ファイル: SetSpeed.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);

        tree.actions.SetSpeed(speed);
        parent.ReceiveStatus(Status.Success);
    }
コード例 #9
0
ファイル: CheckBlackboard.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     object obj1 = tree.GetFromBlackboard<object>(obj1Key);
     object obj2 = tree.GetFromBlackboard<object>(obj2Key);
     //if(obj1 == default(T) || obj2 == default(T)){
     //	parent.ReceiveStatus(Status.Failure);
     //}
     //TODO CHECKS
     if(obj1.Equals(obj2)){
         parent.ReceiveStatus(Status.Success);
     }
     else{
         parent.ReceiveStatus(Status.Failure);
     }
 }
コード例 #10
0
ファイル: SetRandomRoom.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     if(roomKey == null){
         tree.AddToBlackboard(destinationKey, tree.actions.RandomPointInRandomRoom());
     }
     else{
         GameObject room = tree.GetFromBlackboard<GameObject>(roomKey);
         if(room == null){
             parent.ReceiveStatus(Status.Failure);
             return;
         }
         tree.AddToBlackboard(destinationKey, tree.actions.RandomPointInRoom(room));
     }
     parent.ReceiveStatus(Status.Success);
 }
コード例 #11
0
ファイル: SetResponse.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);

        if(inputSentence == null){
            inputSentence = (Sentence) tree.GetFromBlackboard<Sentence>(inputSentenceKey);
        }

        if(inputSentence != null){
            Sentence response = tree.eventManager.knowledgeBase.GetResponse(inputSentence);
            tree.AddToBlackboard(responseKey, response);
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #12
0
ファイル: DebugMessage.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     Debug.Log (tree.eventManager.gameObject);
     Debug.Log ("says");
     Debug.Log (message);
     parent.ReceiveStatus(Status.Success);
 }
コード例 #13
0
ファイル: WhisperSentence.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);
        Sentence sentence = (Sentence) tree.GetFromBlackboard<Sentence>(sentenceKey);

        if(target == null){
            target = (GameObject) tree.GetFromBlackboard<GameObject>(targetKey);
        }

        if(sentence != null && target != null){
            tree.actions.Whisper(sentence, target);
            parent.ReceiveStatus(Status.Success);
        }
        else{
            parent.ReceiveStatus(Status.Failure);
        }
    }
コード例 #14
0
ファイル: SetAloneWith.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     GameObject location = tree.GetFromBlackboard<GameObject>(locationKey);
     if(location == null){
         parent.ReceiveStatus(Status.Failure);
     }
     else{
         GameObject aloneWith = tree.actions.GetAloneWith(location);
         if(aloneWith != null){
             tree.AddToBlackboard(aloneWithKey, aloneWith);
             parent.ReceiveStatus(Status.Success);
         }
         else{
             parent.ReceiveStatus(Status.Failure);
         }
     }
 }
コード例 #15
0
ファイル: Follow.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke (parent);
     GameObject target = tree.GetFromBlackboard<GameObject>(targetKey);
     if(target != null){
         tree.actions.Follow(target, this, stopping);
     }
     else{
         parent.ReceiveStatus(Status.Failure);
     }
 }
コード例 #16
0
ファイル: Kill.cs プロジェクト: rdstn/Project
 public override void Poke(Parent parent)
 {
     base.Poke(parent);
     GameObject victim = tree.GetFromBlackboard<GameObject>(victimKey);
     if(victim == default(GameObject)){
         parent.ReceiveStatus(Status.Failure);
     }
     else{
         tree.actions.Kill(victim, this);
     }
 }
コード例 #17
0
ファイル: SetLocation.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke (parent);
        GameObject target = tree.GetFromBlackboard<GameObject>(targetKey);
        if(target == null){
            //Debug.Log ("Target Null");
            parent.ReceiveStatus(Status.Failure);
            return;
        }

        GameObject location = tree.actions.FindRoomTargetIsIn(target);
        if(location == null){
            //Debug.Log ("Location Null");
            parent.ReceiveStatus(Status.Failure);
            return;
        }

        tree.AddToBlackboard(locationKey, location);
        parent.ReceiveStatus(Status.Success);
    }
コード例 #18
0
ファイル: TravelTo.cs プロジェクト: rdstn/Project
    public override void Poke(Parent parent)
    {
        base.Poke(parent);

        if(destinationSet == false){
            destination = tree.GetFromBlackboard<Vector3>(destinationKey);
        }

        if(destination == default(Vector3)){
            parent.ReceiveStatus(Status.Failure);
        }
        else{
            //Debug.Log (tree.eventManager.gameObject);
            //Debug.Log (destination);
            tree.actions.TravelTo(destination, this);
        }
    }