Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     tree     = GetComponent <BehaviorTree> ();
     hasEnemy = (SharedBool)tree.GetVariable("hasEnemy");
     enemy    = (SharedGameObject)tree.GetVariable("enemy");
     hp       = (SharedFloat)tree.GetVariable("hp");
 }
Beispiel #2
0
 public override void OnStart()
 {
     GetComponent<Animator> ().Play ("hurt");
     animator = GetComponent<Animator> ();
     tree = GetComponent<BehaviorTree> ();
     hurted = (SharedBool)tree.GetVariable ("hurted");
 }
Beispiel #3
0
 public virtual void OnReset()
 {
     this.speed          = (SharedFloat)10f;
     this.angularSpeed   = (SharedFloat)120f;
     this.arriveDistance = (SharedFloat)1f;
     this.stopOnTaskEnd  = (SharedBool)true;
 }
Beispiel #4
0
 public override void OnReset()
 {
     target            = null;
     rotationDampening = 10;
     rotateWeapon      = true;
     aimThreshold      = 0.4f;
 }
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     successProbability = 0.5f;
     seed = 0;
     useSeed = false;
 }
Beispiel #6
0
 public override void OnReset()
 {
     to           = 0;
     time         = 0;
     snap         = false;
     storeTweener = null;
 }
Beispiel #7
0
 /// <summary>
 /// Resets the objects back to their default values.
 /// </summary>
 public override void OnReset()
 {
     m_TargetGameObject    = null;
     m_EffectType          = string.Empty;
     m_Start               = true;
     m_AlwaysReturnSuccess = true;
 }
Beispiel #8
0
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     maxTaskAccessCount = null;
     linkedTaskGuards = null;
     waitUntilTaskAvailable = true;
 }
Beispiel #9
0
 public override void OnReset()
 {
     // Reset the properties back to their original values
     behaviorGameObject = null;
     group = 0;
     pauseBehavior = false;
 }
Beispiel #10
0
 // Reset the public variables
 public override void OnReset()
 {
     base.OnReset();
     randomPatrol          = false;
     waypointPauseDuration = 0;
     waypoints             = null;
 }
        public override void OnReset()
        {
            base.OnReset();

            separation = new Vector2(2, 2);
            fill       = false;
        }
Beispiel #12
0
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     maxTaskAccessCount     = null;
     linkedTaskGuards       = null;
     waitUntilTaskAvailable = true;
 }
Beispiel #13
0
 public override void OnReset()
 {
     this.waitTime      = 1f;
     this.randomWait    = false;
     this.randomWaitMin = 1f;
     this.randomWaitMax = 1f;
 }
Beispiel #14
0
 public override void OnReset()
 {
     base.OnReset();
     this.randomPatrol          = (SharedBool)false;
     this.waypointPauseDuration = (SharedFloat)0.0f;
     this.waypoints             = (SharedGameObjectList)null;
 }
Beispiel #15
0
    public override TaskStatus OnUpdate()
    {
        //Debug.Log("transform.localEulerAngles.y:" + transform.localEulerAngles.y);
        if (transform.position.z < doorZ)//房间A
        {
            if (transform.position.x <= (waitLine + 5))
            {
                isAEmpty = (SharedBool)GlobalVariables.Instance.GetVariable("isRoomAEmpty");
                if (isAEmpty.Value)
                {
                    return(TaskStatus.Failure);
                }
                else
                {
                    if (transform.position.x > doorX)
                    {
                        if (transform.localEulerAngles.y < 180)//出门
                        {
                            Debug.Log("出门");
                            return(TaskStatus.Failure);
                        }
                        else
                        {
                            Debug.Log("等待");
                            return(TaskStatus.Success);
                        }
                    }
                }
            }
        }
        else//房间B
        {
            if (transform.position.x <= (waitLine + 5))
            {
                isBEmpty = (SharedBool)GlobalVariables.Instance.GetVariable("isRoomBEmpty");
                if (isBEmpty.Value)
                {
                    return(TaskStatus.Failure);
                }
                else
                {
                    if (transform.position.x > doorX)
                    {
                        if (transform.localEulerAngles.y < 180)//出门
                        {
                            Debug.Log("出门");
                            return(TaskStatus.Failure);
                        }
                        else
                        {
                            Debug.Log("等待");
                            return(TaskStatus.Success);
                        }
                    }
                }
            }
        }

        return(TaskStatus.Failure);
    }
Beispiel #16
0
 // Use this for initialization
 void Start()
 {
     tree = GetComponent<BehaviorTree> ();
     hasEnemy = (SharedBool)tree.GetVariable ("hasEnemy");
     enemy = (SharedGameObject)tree.GetVariable ("enemy");
     hp = (SharedFloat)tree.GetVariable ("hp");
 }
Beispiel #17
0
 public override void OnStart()
 {
     GetComponent <Animator> ().Play("hurt");
     animator = GetComponent <Animator> ();
     tree     = GetComponent <BehaviorTree> ();
     hurted   = (SharedBool)tree.GetVariable("hurted");
 }
 public virtual void OnReset()
 {
     this.behaviorGameObject = (SharedGameObject)null;
     this.group                = (SharedInt)0;
     this.waitForCompletion    = (SharedBool)false;
     this.synchronizeVariables = (SharedBool)false;
 }
Beispiel #19
0
 public virtual void OnReset()
 {
     this.waitTime      = (SharedFloat)1f;
     this.randomWait    = (SharedBool)false;
     this.randomWaitMin = (SharedFloat)1f;
     this.randomWaitMax = (SharedFloat)1f;
 }
Beispiel #20
0
 public override void OnReset()
 {
     // Reset the properties back to their original values
     text     = "";
     logError = false;
     logTime  = false;
 }
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     successProbability = 0.5f;
     seed    = 0;
     useSeed = false;
 }
 public override void OnReset()
 {
     // Reset the properties back to their original values.
     behaviorGameObject = null;
     group = 0;
     waitForCompletion = false;
 }
 /// <summary>
 /// Reset the values back to their defaults.
 /// </summary>
 public override void OnReset()
 {
     speed          = 10;
     angularSpeed   = 120;
     arriveDistance = 1;
     stopOnTaskEnd  = true;
 }
Beispiel #24
0
 public override void OnReset()
 {
     // Reset the properties back to their original values.
     behaviorGameObject = null;
     group             = 0;
     waitForCompletion = false;
 }
Beispiel #25
0
 public override void OnReset()
 {
     this.behaviorGameObject = null;
     this.group                = 0;
     this.waitForCompletion    = false;
     this.synchronizeVariables = false;
 }
Beispiel #26
0
        public override void OnReset()
        {
            base.OnReset();

            radius  = 5;
            concave = true;
        }
 public override void OnReset()
 {
     // Reset the properties back to their original values
     behaviorGameObject = null;
     group         = 0;
     pauseBehavior = false;
 }
Beispiel #28
0
 public override void OnReset()
 {
     if (specifiedObject != null) {
         specifiedObject.Value = null;
     }
     enabled = false;
 }
Beispiel #29
0
        public override void OnReset()
        {
            base.OnReset();

            separation         = new Vector2(2, 2);
            backPositionOffset = false;
        }
Beispiel #30
0
 protected override void OnReset()
 {
     duration      = 1;
     randomWait    = false;
     randomWaitMin = 1;
     randomWaitMax = 1;
 }
Beispiel #31
0
        public override void OnReset()
        {
            base.OnReset();

            separation = 2;
            right      = false;
        }
 /// <summary>
 /// Resets the objects back to their default values.
 /// </summary>
 public override void OnReset()
 {
     m_TargetGameObject    = null;
     m_AbilityType         = string.Empty;
     m_PriorityIndex       = -1;
     m_Start               = true;
     m_AlwaysReturnSuccess = false;
 }
 public override void OnReset()
 {
     firstObject  = null;
     secondObject = null;
     threshold    = 2;
     isAbove      = null;
     difference   = null;
 }
Beispiel #34
0
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     waitTime = 1;
     randomWait = false;
     randomWaitMin = 1;
     randomWaitMax = 1;
 }
 public override void OnReset()
 {
     targetGameObject = null;
     targetObject = null;
     targetPosition = Vector3.zero;
     ignoreHeight = true;
     storeValue = 0;
 }
Beispiel #36
0
        // Reset the public variables
        public override void OnReset()
        {
            base.OnReset();

            randomPatrol = false;
            waypointPauseDuration = 0;
            waypoints = null;
        }
 public override void OnReset()
 {
     if (this.specifiedObject != null)
     {
         this.specifiedObject.Value = null;
     }
     this.enabled = false;
 }
Beispiel #38
0
 public override void OnReset()
 {
     thisGameObject = null;
     targetObject   = null;
     targetPosition = Vector3.zero;
     ignoreHeight   = true;
     storeValue     = 0;
 }
Beispiel #39
0
 public override void OnReset()
 {
     start = Vector3.zero;
     end = Vector3.zero;
     color = Color.white;
     duration = 0f;
     depthTest = true;
 }
Beispiel #40
0
 public override void OnReset()
 {
     // Reset the public properties back to their original values
     waitTime      = 1;
     randomWait    = false;
     randomWaitMin = 1;
     randomWaitMax = 1;
 }
 public override void OnReset()
 {
     if (specifiedObject != null)
     {
         specifiedObject.Value = null;
     }
     enabled = false;
 }
Beispiel #42
0
 // Reset the public variables
 public override void OnReset()
 {
     usePhysics2D = false;
     rotationEpsilon = 0.5f;
     maxLookAtRotationDelta = 1f;
     onlyY = false;
     target = null;
     targetRotation = Vector3.zero;
 }
Beispiel #43
0
 public override void OnReset()
 {
     // Reset the properties back to their original values
     textFormat = string.Empty;
     logError = false;
     arg0 = null;
     arg1 = null;
     arg2 = null;
     arg3 = null;
 }
    public override TaskStatus OnUpdate()
    {
        isAttacked = (SharedBool)GlobalVariables.Instance.GetVariable("IsAttacked");

        if (isAttacked.Value)
        {
            return TaskStatus.Success;
        }

        return TaskStatus.Failure;
    }
Beispiel #45
0
        // Reset the public variables
        public override void OnReset()
        {
            base.OnReset();

            wanderDistance = 10;
            wanderRate = 1;
            fieldOfViewAngle = 90;
            viewDistance = 30;
            senseAudio = true;
            hearingRadius = 30;
            audibilityThreshold = 0.05f;
        }
Beispiel #46
0
 public override void OnReset()
 {
     targetGameObject = null;
     mute = false;
 }
Beispiel #47
0
 public override void OnReset()
 {
     targetValue = false;
     targetVariable = false;
 }
 public override void OnReset()
 {
     show = false;
     window = null;
 }
Beispiel #49
0
 public override void OnReset()
 {
     // Reset the properties back to their original values
     text = "";
     logError = false;
 }
 public override void OnReset()
 {
     variable = false;
     compareTo = false;
 }
Beispiel #51
0
 public override void OnReset()
 {
     // Reset the public properties back to their original values.
     count = 0;
     endOnFailure = true;
 }
Beispiel #52
0
 public override void OnReset()
 {
     key = KeyCode.None;
     storeResult = false;
 }
Beispiel #53
0
 public override void OnReset()
 {
     targetGameObject = null;
     storeValue = false;
 }
 public override void OnReset()
 {
     blueprintID = 0;
     learned = false;
 }
Beispiel #55
0
        // Reset the public variables
        public override void OnReset()
        {
            base.OnReset();

            maxCoverDistance = 1000;
            maxRaycasts = 100;
            rayStep = 1;
            coverOffset = 2;
            lookAtCoverPoint = false;
            rotationEpsilon = 0.5f;
        }
Beispiel #56
0
 public override void OnReset()
 {
     targetGameObject = null;
     fixedAngle = false;
 }
Beispiel #57
0
 public override void OnReset()
 {
     buttonName = "Fire1";
     storeResult = false;
 }
Beispiel #58
0
 public override void OnReset()
 {
     targetGameObject = null;
     rootMotion = false;
 }
 public override void OnReset()
 {
     targetGameObject = null;
     ignoreListenerPause = false;
 }
Beispiel #60
0
 public override void OnReset()
 {
     // Reset the properties back to their original values.
     interruptTasks = null;
     interruptSuccess = false;
 }