public override void OnReset() { targetGameObject = null; force = Vector3.zero; position = Vector3.zero; forceMode = ForceMode.Force; }
public override void OnStart() { if ((targetTransform == null || targetTransform.Value == null) && targetPosition == null) { Debug.LogError("Error: A MoveTowards target value is not set."); targetPosition = new SharedVector3(); // create a new SharedVector3 to prevent repeated errors } }
public override void OnReset() { targetGameObject = null; point = Vector3.zero; axis = Vector3.zero; angle = 0; }
public override void OnReset() { start = Vector3.zero; end = Vector3.zero; color = Color.white; duration = 0f; depthTest = true; }
public override void OnReset() { targetGameObject = null; targetObject = null; targetPosition = Vector3.zero; ignoreHeight = true; storeValue = 0; }
// Reset the public variables public override void OnReset() { usePhysics2D = false; rotationEpsilon = 0.5f; maxLookAtRotationDelta = 1f; onlyY = false; target = null; targetRotation = Vector3.zero; }
public override void OnReset() { originGameObject = null; originPosition = Vector3.zero; direction = Vector3.zero; distance = -1; layerMask = -1; space = Space.Self; }
public override void OnAwake() { //birthPos = (SharedVector3)GlobalVariables.Instance.GetVariable("MonsterBirth_Pos"); birthPos = (SharedVector3)Owner.GetVariable("MonsterBirth_Pos"); gameObject.transform.position = birthPos.Value; state = gameObject.animation["f_out"]; }
public override void OnReset() { targetGameObject = null; explosionForce = 0; explosionPosition = Vector3.zero; explosionRadius = 0; upwardsModifier = 0; forceMode = ForceMode.Force; }
public override void OnReset() { targetGameObject = null; matchPosition = Vector3.zero; matchRotation = Quaternion.identity; targetBodyPart = AvatarTarget.Root; weightMaskPosition = Vector3.zero; weightMaskRotation = 0; startNormalizedTime = 0; targetNormalizedTime = 1; }
public override void OnStart() { targetPosition = (SharedVector3)Owner.GetVariable("MonsterMovement_Target"); if ((targetTransform == null || targetTransform.Value == null) && targetPosition == null) { Debug.LogError("Error: A MoveTowards target value is not set."); targetPosition = new SharedVector3(); // create a new SharedVector3 to prevent repeated errors } gameObject.animation.Play(state.clip.name, PlayMode.StopAll); }
public override TaskStatus OnUpdate() { Vector3 position; Vector3 dir = direction.Value; if (originGameObject.Value != null) { position = originGameObject.Value.transform.position; if (space == Space.Self) { dir = originGameObject.Value.transform.TransformDirection(direction.Value); } } else { position = originPosition.Value; } RaycastHit hit; if (Physics.Raycast(position, dir, out hit, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask)) { storeHitObject = hit.collider.gameObject; storeHitPoint = hit.point; storeHitNormal = hit.normal; storeHitDistance = hit.distance; return TaskStatus.Success; } return TaskStatus.Failure; }
public override void OnReset() { variable = Vector3.zero; compareTo = Vector3.zero; }
// Reset the public variables public override void OnReset() { fieldOfViewAngle = 90; viewDistance = 1000; offset = Vector3.zero; }
public override void OnReset() { targetGameObject = null; translation = Vector3.zero; relativeTo = Space.Self; }
public override void OnReset() { operation = Operation.Add; firstVector3 = secondVector3 = storeResult = Vector3.zero; }
public override void OnReset() { vector3Variable = storeResult = Vector3.zero; multiplyBy = 0; }
public virtual void OnReset() { this.targetGameObject = (SharedGameObject)null; this.translation = (SharedVector3)Vector3.get_zero(); this.relativeTo = (Space)1; }
public override void OnReset() { position = Vector3.zero; }
public override void OnReset() { targetGameObject = null; torque = Vector3.zero; forceMode = ForceMode.Force; }
public override void OnReset() { vector3Variable = Vector3.zero; storeResult = 0; }
public override void OnReset() { targetGameObject = null; position = Vector3.zero; rotation = Quaternion.identity; }
public override void OnReset() { targetGameObject = null; allowEmptyTarget = false; storeValue = Vector3.zero; }
public override void OnReset() { base.OnReset(); target = null; targetPosition = Vector3.zero; }
public override void OnReset() { targetPosition = Vector3.zero; speed = 0; }
public override void OnReset() { vector3Value = Vector3.zero; vector3Variable = Vector3.zero; }
public virtual void OnReset() { this.operation = Operator.Operation.Add; this.firstVector3 = this.secondVector3 = this.storeResult = (SharedVector3)Vector3.get_zero(); }
public override void OnReset() { currentRotation = targetRotation = storeResult = Vector3.zero; maxDegreesDelta = maxMagnitudeDelta = 0; }
public override void OnReset() { vector3Variable = Vector3.zero; storeX = storeY = storeZ = 0; }
public virtual void OnReset() { this.firstVector3 = this.secondVector3 = (SharedVector3)Vector3.get_zero(); this.storeResult = (SharedFloat)0.0f; }
public virtual void OnReset() { this.targetGameObject = (SharedGameObject)null; this.velocity = (SharedVector3)Vector3.get_zero(); }
public virtual void OnReset() { this.vector3Variable = (SharedVector3)Vector3.get_zero(); this.storeResult = (SharedFloat)0.0f; }
// Move towards the destination. Return success once we have reached the destination. Return failure if the destination has respawned and we no longer should be seeking it. // Will return running if we are currently seeking public override TaskStatus OnUpdate() { // use the nav agent's destination position if we are on an alternate path or the target is null. We are using an alternate path if the previous path would have collided with // an object on defense. target will be null when we are seeking a position specified by the position variable var targetPosition = (alternatePath || target.Value == null ? navMeshAgent.destination : target.Value.position); targetPosition.y = navMeshAgent.destination.y; // ignore y // we can only arrive if the path isn't pending if (!navMeshAgent.pathPending) { var thisPosition = transform.position; thisPosition.y = targetPosition.y; // If the magnitude is less than the arrive magnitude then we have arrived at the destination if (Vector3.SqrMagnitude(thisPosition - navMeshAgent.destination) < SampleConstants.ArriveMagnitude) { // If we arrived from an alternate path then switch back to the regular path if (alternatePath) { alternatePath = false; targetPosition = target.Value.position; } else { // return success if we don't need to rotate to the target or we are already at the target's rotation if (!rotateToTarget || transform.rotation == target.Value.rotation) { return(TaskStatus.Success); } // not done yet. still need to rotate transform.rotation = Quaternion.RotateTowards(transform.rotation, target.Value.rotation, rotationSpeed.Value * Time.deltaTime); } } // fail if the target moved too quickly in one frame. This happens after the target has been caught and respawns float distance; if (prevMagnitude * 2 < (distance = Vector3.SqrMagnitude(thisPosition - targetPosition))) { return(TaskStatus.Failure); } prevMagnitude = distance; } // try not to head directly for a defensive object RaycastHit hit; Vector3 hitPoint; if (avoidDefeneUnits && (rayCollision(transform.position - transform.right, targetPosition, out hit) || rayCollision(transform.position + transform.right, targetPosition, out hit))) { // looks like an object is within the path. Avoid the object by setting a new destination towards the right of the object that we would have hit hitPoint = hit.point + transform.right * 5; hitPoint.y = transform.position.y; navMeshAgent.destination = hitPoint; // The avoid object may still be in the way even though we moved to the right of the object. If this is the case then move to the left and hope that works if (rayCollision(transform.position, navMeshAgent.destination, out hit)) { hitPoint = hit.point - transform.right * 5; hitPoint.y = transform.position.y; navMeshAgent.destination = hitPoint; } // remember that we are taking an alternate path to prevent the agent from jittering back and forth alternatePath = true; var thisPosition = transform.position; thisPosition.y = hitPoint.y; prevMagnitude = Vector3.SqrMagnitude(thisPosition - hitPoint); } else if (navMeshAgent.destination != targetPosition) { // the target position has changed since we last set the destination. Update the destination navMeshAgent.destination = targetPosition; } return(TaskStatus.Running); }
public override void OnReset() { this.targetGameObject = null; this.position = Vector3.zero; }
public virtual void OnReset() { this.storeValue = (SharedVector3)Vector3.get_zero(); }
public override void OnReset() { fromDirection = toDirection = Vector3.zero; storeResult = Quaternion.identity; }
public override void OnReset() { targetGameObject = null; localPosition = Vector3.zero; }
public override void OnReset() { storeResult = Vector3.zero; }
public override void OnReset() { targetGameObject = null; destination = Vector3.zero; }
public override void OnReset() { eulerVector = Vector3.zero; storeResult = Quaternion.identity; }
public override void OnReset() { targetGameObject = null; velocity = Vector3.zero; }
public override void OnReset() { targetGameObject = null; eulerAngles = Vector3.zero; relativeTo = Space.Self; }
public override void OnReset() { vector3Variable = Vector2.zero; storeResult = Vector3.zero; }
public virtual void OnReset() { this.targetGameObject = (SharedGameObject)null; this.eulerAngles = (SharedVector3)Vector3.get_zero(); }
public override void OnReset() { target = null; thePosition = Vector3.zero; distanceMultiplier = 2; }
public override void OnReset() { targetGameObject = null; angularVelocity = Vector3.zero; }
public override void OnReset() { targetGameObject = null; eulerAngles = Vector3.zero; }
public override void OnReset() { targetVariable = Vector3.zero; }
public override void OnReset() { currentPosition = targetPosition = storeResult = Vector3.zero; speed = 0; }
public virtual void OnReset() { this.targetGameObject = (SharedGameObject)null; this.position = (SharedVector3)Vector3.get_zero(); this.rotation = (SharedQuaternion)Quaternion.get_identity(); }
public override void OnReset() { targetGameObject = null; storeValue = Vector3.zero; }
public override void OnReset() { start = Vector3.zero; direction = Vector3.zero; color = Color.white; }
public override void OnReset() { targetGameObject = null; speed = Vector3.zero; }
public override void OnReset() { targetGameObject = null; center = Vector3.zero; }
public override void OnReset() { this.targetGameObject = null; this.angularVelocity = Vector3.zero; }