From 97da432c35b8c7aaf9dd2c39e2aa4b1f55f36065 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Jan 2021 16:15:06 +0800 Subject: +behaviour designer --- .../Assets/Behavior Designer/Runtime/Actions.meta | 5 + .../Runtime/Actions/BehaviorTreeReference.cs | 17 +++ .../Runtime/Actions/BehaviorTreeReference.cs.meta | 8 ++ .../Behavior Designer/Runtime/Actions/Idle.cs | 15 +++ .../Behavior Designer/Runtime/Actions/Idle.cs.meta | 8 ++ .../Behavior Designer/Runtime/Actions/Log.cs | 33 ++++++ .../Behavior Designer/Runtime/Actions/Log.cs.meta | 8 ++ .../Runtime/Actions/PerformInterruption.cs | 29 +++++ .../Runtime/Actions/PerformInterruption.cs.meta | 8 ++ .../Runtime/Actions/Reflection.meta | 5 + .../Runtime/Actions/Reflection/GetFieldValue.cs | 58 ++++++++++ .../Actions/Reflection/GetFieldValue.cs.meta | 8 ++ .../Runtime/Actions/Reflection/GetPropertyValue.cs | 58 ++++++++++ .../Actions/Reflection/GetPropertyValue.cs.meta | 8 ++ .../Runtime/Actions/Reflection/InvokeMethod.cs | 86 +++++++++++++++ .../Actions/Reflection/InvokeMethod.cs.meta | 8 ++ .../Runtime/Actions/Reflection/SetFieldValue.cs | 57 ++++++++++ .../Actions/Reflection/SetFieldValue.cs.meta | 8 ++ .../Runtime/Actions/Reflection/SetPropertyValue.cs | 57 ++++++++++ .../Actions/Reflection/SetPropertyValue.cs.meta | 8 ++ .../Runtime/Actions/RestartBehaviorTree.cs | 56 ++++++++++ .../Runtime/Actions/RestartBehaviorTree.cs.meta | 8 ++ .../Behavior Designer/Runtime/Actions/SendEvent.cs | 73 +++++++++++++ .../Runtime/Actions/SendEvent.cs.meta | 8 ++ .../Runtime/Actions/StartBehaviorTree.cs | 90 ++++++++++++++++ .../Runtime/Actions/StartBehaviorTree.cs.meta | 8 ++ .../Runtime/Actions/StopBehaviorTree.cs | 57 ++++++++++ .../Runtime/Actions/StopBehaviorTree.cs.meta | 8 ++ .../Behavior Designer/Runtime/Actions/Wait.cs | 67 ++++++++++++ .../Behavior Designer/Runtime/Actions/Wait.cs.meta | 8 ++ .../Behavior Designer/Runtime/Basic Tasks.meta | 5 + .../Runtime/Basic Tasks/Animation.meta | 5 + .../Runtime/Basic Tasks/Animation/Blend.cs | 51 +++++++++ .../Runtime/Basic Tasks/Animation/Blend.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/CrossFade.cs | 51 +++++++++ .../Basic Tasks/Animation/CrossFade.cs.meta | 8 ++ .../Basic Tasks/Animation/CrossFadeQueued.cs | 54 ++++++++++ .../Basic Tasks/Animation/CrossFadeQueued.cs.meta | 8 ++ .../Basic Tasks/Animation/GetAnimatePhysics.cs | 46 ++++++++ .../Animation/GetAnimatePhysics.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/IsPlaying.cs | 47 ++++++++ .../Basic Tasks/Animation/IsPlaying.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/Play.cs | 52 +++++++++ .../Runtime/Basic Tasks/Animation/Play.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/PlayQueued.cs | 51 +++++++++ .../Basic Tasks/Animation/PlayQueued.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/Rewind.cs | 49 +++++++++ .../Runtime/Basic Tasks/Animation/Rewind.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/Sample.cs | 41 +++++++ .../Runtime/Basic Tasks/Animation/Sample.cs.meta | 8 ++ .../Basic Tasks/Animation/SetAnimatePhysics.cs | 45 ++++++++ .../Animation/SetAnimatePhysics.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/SetWrapMode.cs | 45 ++++++++ .../Basic Tasks/Animation/SetWrapMode.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animation/Stop.cs | 49 +++++++++ .../Runtime/Basic Tasks/Animation/Stop.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator.meta | 5 + .../Runtime/Basic Tasks/Animator/CrossFade.cs | 53 +++++++++ .../Runtime/Basic Tasks/Animator/CrossFade.cs.meta | 8 ++ .../Basic Tasks/Animator/GetApplyRootMotion.cs | 45 ++++++++ .../Animator/GetApplyRootMotion.cs.meta | 8 ++ .../Basic Tasks/Animator/GetBoolParameter.cs | 48 +++++++++ .../Basic Tasks/Animator/GetBoolParameter.cs.meta | 8 ++ .../Animator/GetCurrentAnimatorStateNameHash.cs | 50 +++++++++ .../GetCurrentAnimatorStateNameHash.cs.meta | 8 ++ .../Basic Tasks/Animator/GetDeltaPosition.cs | 45 ++++++++ .../Basic Tasks/Animator/GetDeltaPosition.cs.meta | 8 ++ .../Basic Tasks/Animator/GetDeltaRotation.cs | 46 ++++++++ .../Basic Tasks/Animator/GetDeltaRotation.cs.meta | 8 ++ .../Basic Tasks/Animator/GetFloatParameter.cs | 48 +++++++++ .../Basic Tasks/Animator/GetFloatParameter.cs.meta | 8 ++ .../Basic Tasks/Animator/GetGravityWeight.cs | 45 ++++++++ .../Basic Tasks/Animator/GetGravityWeight.cs.meta | 8 ++ .../Basic Tasks/Animator/GetIntegerParameter.cs | 48 +++++++++ .../Animator/GetIntegerParameter.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/GetLayerWeight.cs | 48 +++++++++ .../Basic Tasks/Animator/GetLayerWeight.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/GetSpeed.cs | 45 ++++++++ .../Runtime/Basic Tasks/Animator/GetSpeed.cs.meta | 8 ++ .../Basic Tasks/Animator/GetStringToHash.cs | 28 +++++ .../Basic Tasks/Animator/GetStringToHash.cs.meta | 8 ++ .../Basic Tasks/Animator/InterruptMatchTarget.cs | 44 ++++++++ .../Animator/InterruptMatchTarget.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/IsInTransition.cs | 42 ++++++++ .../Basic Tasks/Animator/IsInTransition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/IsName.cs | 45 ++++++++ .../Runtime/Basic Tasks/Animator/IsName.cs.meta | 8 ++ .../Animator/IsParameterControlledByCurve.cs | 42 ++++++++ .../Animator/IsParameterControlledByCurve.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/MatchTarget.cs | 62 +++++++++++ .../Basic Tasks/Animator/MatchTarget.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/Play.cs | 50 +++++++++ .../Runtime/Basic Tasks/Animator/Play.cs.meta | 8 ++ .../Basic Tasks/Animator/SetApplyRootMotion.cs | 44 ++++++++ .../Animator/SetApplyRootMotion.cs.meta | 8 ++ .../Basic Tasks/Animator/SetBoolParameter.cs | 62 +++++++++++ .../Basic Tasks/Animator/SetBoolParameter.cs.meta | 8 ++ .../Basic Tasks/Animator/SetFloatParameter.cs | 63 +++++++++++ .../Basic Tasks/Animator/SetFloatParameter.cs.meta | 8 ++ .../Basic Tasks/Animator/SetIntegerParameter.cs | 63 +++++++++++ .../Animator/SetIntegerParameter.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/SetLayerWeight.cs | 47 ++++++++ .../Basic Tasks/Animator/SetLayerWeight.cs.meta | 8 ++ .../Basic Tasks/Animator/SetLookAtPosition.cs | 44 ++++++++ .../Basic Tasks/Animator/SetLookAtPosition.cs.meta | 8 ++ .../Basic Tasks/Animator/SetLookAtWeight.cs | 57 ++++++++++ .../Basic Tasks/Animator/SetLookAtWeight.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/SetSpeed.cs | 44 ++++++++ .../Runtime/Basic Tasks/Animator/SetSpeed.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/SetTrigger.cs | 44 ++++++++ .../Basic Tasks/Animator/SetTrigger.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/StartPlayback.cs | 41 +++++++ .../Basic Tasks/Animator/StartPlayback.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/StartRecording.cs | 44 ++++++++ .../Basic Tasks/Animator/StartRecording.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/StopPlayback.cs | 41 +++++++ .../Basic Tasks/Animator/StopPlayback.cs.meta | 8 ++ .../Runtime/Basic Tasks/Animator/StopRecording.cs | 41 +++++++ .../Basic Tasks/Animator/StopRecording.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource.meta | 5 + .../AudioSource/GetIgnoreListenerPause.cs | 45 ++++++++ .../AudioSource/GetIgnoreListenerPause.cs.meta | 8 ++ .../AudioSource/GetIgnoreListenerVolume.cs | 45 ++++++++ .../AudioSource/GetIgnoreListenerVolume.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetLoop.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetLoop.cs.meta | 8 ++ .../Basic Tasks/AudioSource/GetMaxDistance.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetMaxDistance.cs.meta | 8 ++ .../Basic Tasks/AudioSource/GetMinDistance.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetMinDistance.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetMute.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetMute.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetPan.cs | 47 ++++++++ .../Runtime/Basic Tasks/AudioSource/GetPan.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetPanLevel.cs | 47 ++++++++ .../Basic Tasks/AudioSource/GetPanLevel.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetPitch.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetPitch.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetPriority.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetPriority.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetSpread.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetSpread.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetTime.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetTime.cs.meta | 8 ++ .../Basic Tasks/AudioSource/GetTimeSamples.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetTimeSamples.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/GetVolume.cs | 45 ++++++++ .../Basic Tasks/AudioSource/GetVolume.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/IsPlaying.cs | 39 +++++++ .../Basic Tasks/AudioSource/IsPlaying.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/Pause.cs | 41 +++++++ .../Runtime/Basic Tasks/AudioSource/Pause.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/Play.cs | 41 +++++++ .../Runtime/Basic Tasks/AudioSource/Play.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/PlayDelayed.cs | 44 ++++++++ .../Basic Tasks/AudioSource/PlayDelayed.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/PlayOneShot.cs | 47 ++++++++ .../Basic Tasks/AudioSource/PlayOneShot.cs.meta | 8 ++ .../Basic Tasks/AudioSource/PlayScheduled.cs | 44 ++++++++ .../Basic Tasks/AudioSource/PlayScheduled.cs.meta | 8 ++ .../Basic Tasks/AudioSource/SetAudioClip.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetAudioClip.cs.meta | 8 ++ .../AudioSource/SetIgnoreListenerPause.cs | 44 ++++++++ .../AudioSource/SetIgnoreListenerPause.cs.meta | 8 ++ .../AudioSource/SetIgnoreListenerVolume.cs | 44 ++++++++ .../AudioSource/SetIgnoreListenerVolume.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetLoop.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetLoop.cs.meta | 8 ++ .../Basic Tasks/AudioSource/SetMaxDistance.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetMaxDistance.cs.meta | 8 ++ .../Basic Tasks/AudioSource/SetMinDistance.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetMinDistance.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetMute.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetMute.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetPan.cs | 46 ++++++++ .../Runtime/Basic Tasks/AudioSource/SetPan.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetPanLevel.cs | 46 ++++++++ .../Basic Tasks/AudioSource/SetPanLevel.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetPitch.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetPitch.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetPriority.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetPriority.cs.meta | 8 ++ .../Basic Tasks/AudioSource/SetRolloffMode.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetRolloffMode.cs.meta | 8 ++ .../Basic Tasks/AudioSource/SetScheduledEndTime.cs | 45 ++++++++ .../AudioSource/SetScheduledEndTime.cs.meta | 8 ++ .../AudioSource/SetScheduledStartTime.cs | 44 ++++++++ .../AudioSource/SetScheduledStartTime.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetSpread.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetSpread.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetTime.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetTime.cs.meta | 8 ++ .../AudioSource/SetVelocityUpdateMode.cs | 44 ++++++++ .../AudioSource/SetVelocityUpdateMode.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/SetVolume.cs | 44 ++++++++ .../Basic Tasks/AudioSource/SetVolume.cs.meta | 8 ++ .../Runtime/Basic Tasks/AudioSource/Stop.cs | 41 +++++++ .../Runtime/Basic Tasks/AudioSource/Stop.cs.meta | 8 ++ .../Runtime/Basic Tasks/Behaviour.meta | 5 + .../Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs | 35 ++++++ .../Basic Tasks/Behaviour/GetIsEnabled.cs.meta | 8 ++ .../Runtime/Basic Tasks/Behaviour/IsEnabled.cs | 29 +++++ .../Basic Tasks/Behaviour/IsEnabled.cs.meta | 8 ++ .../Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs | 34 ++++++ .../Basic Tasks/Behaviour/SetIsEnabled.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider.meta | 5 + .../Runtime/Basic Tasks/BoxCollider/GetCenter.cs | 45 ++++++++ .../Basic Tasks/BoxCollider/GetCenter.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider/GetSize.cs | 45 ++++++++ .../Basic Tasks/BoxCollider/GetSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider/SetCenter.cs | 44 ++++++++ .../Basic Tasks/BoxCollider/SetCenter.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider/SetSize.cs | 44 ++++++++ .../Basic Tasks/BoxCollider/SetSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider2D.meta | 5 + .../Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs | 47 ++++++++ .../Basic Tasks/BoxCollider2D/GetCenter.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider2D/GetSize.cs | 45 ++++++++ .../Basic Tasks/BoxCollider2D/GetSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs | 46 ++++++++ .../Basic Tasks/BoxCollider2D/SetCenter.cs.meta | 8 ++ .../Runtime/Basic Tasks/BoxCollider2D/SetSize.cs | 44 ++++++++ .../Basic Tasks/BoxCollider2D/SetSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/CapsuleCollider.meta | 5 + .../Basic Tasks/CapsuleCollider/GetCenter.cs | 45 ++++++++ .../Basic Tasks/CapsuleCollider/GetCenter.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/GetDirection.cs | 45 ++++++++ .../CapsuleCollider/GetDirection.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/GetHeight.cs | 45 ++++++++ .../Basic Tasks/CapsuleCollider/GetHeight.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/GetRadius.cs | 45 ++++++++ .../Basic Tasks/CapsuleCollider/GetRadius.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/SetCenter.cs | 44 ++++++++ .../Basic Tasks/CapsuleCollider/SetCenter.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/SetDirection.cs | 44 ++++++++ .../CapsuleCollider/SetDirection.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/SetHeight.cs | 44 ++++++++ .../Basic Tasks/CapsuleCollider/SetHeight.cs.meta | 8 ++ .../Basic Tasks/CapsuleCollider/SetRadius.cs | 44 ++++++++ .../Basic Tasks/CapsuleCollider/SetRadius.cs.meta | 8 ++ .../Runtime/Basic Tasks/CharacterController.meta | 5 + .../Basic Tasks/CharacterController/GetCenter.cs | 45 ++++++++ .../CharacterController/GetCenter.cs.meta | 8 ++ .../Basic Tasks/CharacterController/GetHeight.cs | 44 ++++++++ .../CharacterController/GetHeight.cs.meta | 8 ++ .../Basic Tasks/CharacterController/GetRadius.cs | 45 ++++++++ .../CharacterController/GetRadius.cs.meta | 8 ++ .../CharacterController/GetSlopeLimit.cs | 45 ++++++++ .../CharacterController/GetSlopeLimit.cs.meta | 8 ++ .../CharacterController/GetStepOffset.cs | 45 ++++++++ .../CharacterController/GetStepOffset.cs.meta | 8 ++ .../Basic Tasks/CharacterController/GetVelocity.cs | 45 ++++++++ .../CharacterController/GetVelocity.cs.meta | 8 ++ .../CharacterController/HasColliderHit.cs | 43 ++++++++ .../CharacterController/HasColliderHit.cs.meta | 8 ++ .../Basic Tasks/CharacterController/IsGrounded.cs | 39 +++++++ .../CharacterController/IsGrounded.cs.meta | 8 ++ .../Basic Tasks/CharacterController/Move.cs | 44 ++++++++ .../Basic Tasks/CharacterController/Move.cs.meta | 8 ++ .../Basic Tasks/CharacterController/SetCenter.cs | 44 ++++++++ .../CharacterController/SetCenter.cs.meta | 8 ++ .../Basic Tasks/CharacterController/SetHeight.cs | 44 ++++++++ .../CharacterController/SetHeight.cs.meta | 8 ++ .../Basic Tasks/CharacterController/SetRadius.cs | 44 ++++++++ .../CharacterController/SetRadius.cs.meta | 8 ++ .../CharacterController/SetSlopeLimit.cs | 44 ++++++++ .../CharacterController/SetSlopeLimit.cs.meta | 8 ++ .../CharacterController/SetStepOffset.cs | 44 ++++++++ .../CharacterController/SetStepOffset.cs.meta | 8 ++ .../Basic Tasks/CharacterController/SimpleMove.cs | 44 ++++++++ .../CharacterController/SimpleMove.cs.meta | 8 ++ .../Runtime/Basic Tasks/CircleCollider2D.meta | 5 + .../Basic Tasks/CircleCollider2D/GetCenter.cs | 47 ++++++++ .../Basic Tasks/CircleCollider2D/GetCenter.cs.meta | 8 ++ .../Basic Tasks/CircleCollider2D/GetRadius.cs | 45 ++++++++ .../Basic Tasks/CircleCollider2D/GetRadius.cs.meta | 8 ++ .../Basic Tasks/CircleCollider2D/SetCenter.cs | 46 ++++++++ .../Basic Tasks/CircleCollider2D/SetCenter.cs.meta | 8 ++ .../Basic Tasks/CircleCollider2D/SetRadius.cs | 44 ++++++++ .../Basic Tasks/CircleCollider2D/SetRadius.cs.meta | 8 ++ .../Runtime/Basic Tasks/Debug.meta | 5 + .../Runtime/Basic Tasks/Debug/DrawLine.cs | 30 ++++++ .../Runtime/Basic Tasks/Debug/DrawLine.cs.meta | 8 ++ .../Runtime/Basic Tasks/Debug/DrawRay.cs | 30 ++++++ .../Runtime/Basic Tasks/Debug/DrawRay.cs.meta | 8 ++ .../Runtime/Basic Tasks/Debug/LogValue.cs | 24 +++++ .../Runtime/Basic Tasks/Debug/LogValue.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject.meta | 5 + .../Basic Tasks/GameObject/ActiveInHierarchy.cs | 22 ++++ .../GameObject/ActiveInHierarchy.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/ActiveSelf.cs | 22 ++++ .../Basic Tasks/GameObject/ActiveSelf.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/CompareTag.cs | 25 +++++ .../Basic Tasks/GameObject/CompareTag.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/Destroy.cs | 32 ++++++ .../Runtime/Basic Tasks/GameObject/Destroy.cs.meta | 8 ++ .../Basic Tasks/GameObject/DestroyImmediate.cs | 25 +++++ .../GameObject/DestroyImmediate.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/Find.cs | 28 +++++ .../Runtime/Basic Tasks/GameObject/Find.cs.meta | 8 ++ .../GameObject/FindGameObjectsWithTag.cs | 31 ++++++ .../GameObject/FindGameObjectsWithTag.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/FindWithTag.cs | 28 +++++ .../Basic Tasks/GameObject/FindWithTag.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/GetComponent.cs | 31 ++++++ .../Basic Tasks/GameObject/GetComponent.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/GetTag.cs | 28 +++++ .../Runtime/Basic Tasks/GameObject/GetTag.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/Instantiate.cs | 33 ++++++ .../Basic Tasks/GameObject/Instantiate.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/SendMessage.cs | 33 ++++++ .../Basic Tasks/GameObject/SendMessage.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/SetActive.cs | 27 +++++ .../Basic Tasks/GameObject/SetActive.cs.meta | 8 ++ .../Runtime/Basic Tasks/GameObject/SetTag.cs | 27 +++++ .../Runtime/Basic Tasks/GameObject/SetTag.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input.meta | 5 + .../Runtime/Basic Tasks/Input/GetAcceleration.cs | 24 +++++ .../Basic Tasks/Input/GetAcceleration.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetAxis.cs | 45 ++++++++ .../Runtime/Basic Tasks/Input/GetAxis.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetAxisRaw.cs | 44 ++++++++ .../Runtime/Basic Tasks/Input/GetAxisRaw.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetButton.cs | 34 ++++++ .../Runtime/Basic Tasks/Input/GetButton.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetKey.cs | 27 +++++ .../Runtime/Basic Tasks/Input/GetKey.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetMouseButton.cs | 27 +++++ .../Basic Tasks/Input/GetMouseButton.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/GetMousePosition.cs | 24 +++++ .../Basic Tasks/Input/GetMousePosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsButtonDown.cs | 29 +++++ .../Runtime/Basic Tasks/Input/IsButtonDown.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsButtonUp.cs | 29 +++++ .../Runtime/Basic Tasks/Input/IsButtonUp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsKeyDown.cs | 22 ++++ .../Runtime/Basic Tasks/Input/IsKeyDown.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsKeyUp.cs | 22 ++++ .../Runtime/Basic Tasks/Input/IsKeyUp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsMouseDown.cs | 22 ++++ .../Runtime/Basic Tasks/Input/IsMouseDown.cs.meta | 8 ++ .../Runtime/Basic Tasks/Input/IsMouseUp.cs | 22 ++++ .../Runtime/Basic Tasks/Input/IsMouseUp.cs.meta | 8 ++ .../Runtime/Basic Tasks/LayerMask.meta | 5 + .../Runtime/Basic Tasks/LayerMask/GetLayer.cs | 28 +++++ .../Runtime/Basic Tasks/LayerMask/GetLayer.cs.meta | 8 ++ .../Runtime/Basic Tasks/LayerMask/SetLayer.cs | 27 +++++ .../Runtime/Basic Tasks/LayerMask/SetLayer.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light.meta | 5 + .../Runtime/Basic Tasks/Light/GetColor.cs | 45 ++++++++ .../Runtime/Basic Tasks/Light/GetColor.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetCookieSize.cs | 45 ++++++++ .../Basic Tasks/Light/GetCookieSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetIntensity.cs | 45 ++++++++ .../Runtime/Basic Tasks/Light/GetIntensity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetRange.cs | 45 ++++++++ .../Runtime/Basic Tasks/Light/GetRange.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetShadowBias.cs | 45 ++++++++ .../Basic Tasks/Light/GetShadowBias.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetShadowSoftness.cs | 47 ++++++++ .../Basic Tasks/Light/GetShadowSoftness.cs.meta | 8 ++ .../Basic Tasks/Light/GetShadowSoftnessFade.cs | 47 ++++++++ .../Light/GetShadowSoftnessFade.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetShadowStrength.cs | 45 ++++++++ .../Basic Tasks/Light/GetShadowStrength.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/GetSpotAngle.cs | 45 ++++++++ .../Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetColor.cs | 44 ++++++++ .../Runtime/Basic Tasks/Light/SetColor.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetCookie.cs | 44 ++++++++ .../Runtime/Basic Tasks/Light/SetCookie.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetCookieSize.cs | 44 ++++++++ .../Basic Tasks/Light/SetCookieSize.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetCullingMask.cs | 44 ++++++++ .../Basic Tasks/Light/SetCullingMask.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetIntensity.cs | 44 ++++++++ .../Runtime/Basic Tasks/Light/SetIntensity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetRange.cs | 44 ++++++++ .../Runtime/Basic Tasks/Light/SetRange.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetShadowBias.cs | 44 ++++++++ .../Basic Tasks/Light/SetShadowBias.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetShadowSoftness.cs | 46 ++++++++ .../Basic Tasks/Light/SetShadowSoftness.cs.meta | 8 ++ .../Basic Tasks/Light/SetShadowSoftnessFade.cs | 46 ++++++++ .../Light/SetShadowSoftnessFade.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetShadowStrength.cs | 44 ++++++++ .../Basic Tasks/Light/SetShadowStrength.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetShadows.cs | 43 ++++++++ .../Runtime/Basic Tasks/Light/SetShadows.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetSpotAngle.cs | 44 ++++++++ .../Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta | 8 ++ .../Runtime/Basic Tasks/Light/SetType.cs | 43 ++++++++ .../Runtime/Basic Tasks/Light/SetType.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math.meta | 5 + .../Runtime/Basic Tasks/Math/BoolComparison.cs | 25 +++++ .../Basic Tasks/Math/BoolComparison.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/BoolFlip.cs | 23 ++++ .../Runtime/Basic Tasks/Math/BoolFlip.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/BoolOperator.cs | 53 +++++++++ .../Runtime/Basic Tasks/Math/BoolOperator.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/FloatAbs.cs | 23 ++++ .../Runtime/Basic Tasks/Math/FloatAbs.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/FloatClamp.cs | 27 +++++ .../Runtime/Basic Tasks/Math/FloatClamp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/FloatComparison.cs | 52 +++++++++ .../Basic Tasks/Math/FloatComparison.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/FloatOperator.cs | 61 +++++++++++ .../Runtime/Basic Tasks/Math/FloatOperator.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IntAbs.cs | 23 ++++ .../Runtime/Basic Tasks/Math/IntAbs.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IntClamp.cs | 27 +++++ .../Runtime/Basic Tasks/Math/IntClamp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IntComparison.cs | 52 +++++++++ .../Runtime/Basic Tasks/Math/IntComparison.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IntOperator.cs | 62 +++++++++++ .../Runtime/Basic Tasks/Math/IntOperator.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IsFloatPositive.cs | 22 ++++ .../Basic Tasks/Math/IsFloatPositive.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/IsIntPositive.cs | 22 ++++ .../Runtime/Basic Tasks/Math/IsIntPositive.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/Lerp.cs | 30 ++++++ .../Runtime/Basic Tasks/Math/Lerp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/LerpAngle.cs | 30 ++++++ .../Runtime/Basic Tasks/Math/LerpAngle.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/RandomBool.cs | 23 ++++ .../Runtime/Basic Tasks/Math/RandomBool.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/RandomFloat.cs | 36 +++++++ .../Runtime/Basic Tasks/Math/RandomFloat.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/RandomInt.cs | 36 +++++++ .../Runtime/Basic Tasks/Math/RandomInt.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/SetBool.cs | 26 +++++ .../Runtime/Basic Tasks/Math/SetBool.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/SetFloat.cs | 26 +++++ .../Runtime/Basic Tasks/Math/SetFloat.cs.meta | 8 ++ .../Runtime/Basic Tasks/Math/SetInt.cs | 26 +++++ .../Runtime/Basic Tasks/Math/SetInt.cs.meta | 8 ++ .../Runtime/Basic Tasks/Network.meta | 5 + .../Runtime/Basic Tasks/Network/IsClient.cs | 15 +++ .../Runtime/Basic Tasks/Network/IsClient.cs.meta | 8 ++ .../Runtime/Basic Tasks/Network/IsServer.cs | 15 +++ .../Runtime/Basic Tasks/Network/IsServer.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem.meta | 5 + .../Runtime/Basic Tasks/ParticleSystem/Clear.cs | 41 +++++++ .../Basic Tasks/ParticleSystem/Clear.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/GetDuration.cs | 45 ++++++++ .../Basic Tasks/ParticleSystem/GetDuration.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/GetEmissionRate.cs | 49 +++++++++ .../ParticleSystem/GetEmissionRate.cs.meta | 8 ++ .../ParticleSystem/GetEnableEmission.cs | 49 +++++++++ .../ParticleSystem/GetEnableEmission.cs.meta | 8 ++ .../ParticleSystem/GetGravityModifier.cs | 45 ++++++++ .../ParticleSystem/GetGravityModifier.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/GetLoop.cs | 45 ++++++++ .../Basic Tasks/ParticleSystem/GetLoop.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/GetMaxParticles.cs | 45 ++++++++ .../ParticleSystem/GetMaxParticles.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/GetParticleCount.cs | 45 ++++++++ .../ParticleSystem/GetParticleCount.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs | 45 ++++++++ .../ParticleSystem/GetPlaybackSpeed.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/GetTime.cs | 45 ++++++++ .../Basic Tasks/ParticleSystem/GetTime.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/IsAlive.cs | 39 +++++++ .../Basic Tasks/ParticleSystem/IsAlive.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/IsPaused.cs | 39 +++++++ .../Basic Tasks/ParticleSystem/IsPaused.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/IsPlaying.cs | 39 +++++++ .../Basic Tasks/ParticleSystem/IsPlaying.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/IsStopped.cs | 39 +++++++ .../Basic Tasks/ParticleSystem/IsStopped.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/Pause.cs | 41 +++++++ .../Basic Tasks/ParticleSystem/Pause.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/Play.cs | 41 +++++++ .../Basic Tasks/ParticleSystem/Play.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetEmissionRate.cs | 48 +++++++++ .../ParticleSystem/SetEmissionRate.cs.meta | 8 ++ .../ParticleSystem/SetEnableEmission.cs | 49 +++++++++ .../ParticleSystem/SetEnableEmission.cs.meta | 8 ++ .../ParticleSystem/SetGravityModifier.cs | 44 ++++++++ .../ParticleSystem/SetGravityModifier.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/SetLoop.cs | 44 ++++++++ .../Basic Tasks/ParticleSystem/SetLoop.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetMaxParticles.cs | 44 ++++++++ .../ParticleSystem/SetMaxParticles.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs | 44 ++++++++ .../ParticleSystem/SetPlaybackSpeed.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartColor.cs | 44 ++++++++ .../ParticleSystem/SetStartColor.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartDelay.cs | 44 ++++++++ .../ParticleSystem/SetStartDelay.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartLifetime.cs | 44 ++++++++ .../ParticleSystem/SetStartLifetime.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartRotation.cs | 44 ++++++++ .../ParticleSystem/SetStartRotation.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartSize.cs | 44 ++++++++ .../ParticleSystem/SetStartSize.cs.meta | 8 ++ .../Basic Tasks/ParticleSystem/SetStartSpeed.cs | 44 ++++++++ .../ParticleSystem/SetStartSpeed.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/SetTime.cs | 44 ++++++++ .../Basic Tasks/ParticleSystem/SetTime.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/Simulate.cs | 44 ++++++++ .../Basic Tasks/ParticleSystem/Simulate.cs.meta | 8 ++ .../Runtime/Basic Tasks/ParticleSystem/Stop.cs | 41 +++++++ .../Basic Tasks/ParticleSystem/Stop.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics.meta | 5 + .../Runtime/Basic Tasks/Physics/Linecast.cs | 29 +++++ .../Runtime/Basic Tasks/Physics/Linecast.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics/Raycast.cs | 71 ++++++++++++ .../Runtime/Basic Tasks/Physics/Raycast.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics/Spherecast.cs | 74 +++++++++++++ .../Runtime/Basic Tasks/Physics/Spherecast.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics2D.meta | 5 + .../Runtime/Basic Tasks/Physics2D/Circlecast.cs | 73 +++++++++++++ .../Basic Tasks/Physics2D/Circlecast.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics2D/Linecast.cs | 29 +++++ .../Runtime/Basic Tasks/Physics2D/Linecast.cs.meta | 8 ++ .../Runtime/Basic Tasks/Physics2D/Raycast.cs | 72 +++++++++++++ .../Runtime/Basic Tasks/Physics2D/Raycast.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs.meta | 5 + .../Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs | 16 +++ .../Basic Tasks/PlayerPrefs/DeleteAll.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs | 24 +++++ .../Basic Tasks/PlayerPrefs/DeleteKey.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs | 31 ++++++ .../Basic Tasks/PlayerPrefs/GetFloat.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/GetInt.cs | 31 ++++++ .../Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/GetString.cs | 31 ++++++ .../Basic Tasks/PlayerPrefs/GetString.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/HasKey.cs | 22 ++++ .../Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/Save.cs | 16 +++ .../Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs | 27 +++++ .../Basic Tasks/PlayerPrefs/SetFloat.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/SetInt.cs | 27 +++++ .../Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta | 8 ++ .../Runtime/Basic Tasks/PlayerPrefs/SetString.cs | 27 +++++ .../Basic Tasks/PlayerPrefs/SetString.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion.meta | 5 + .../Runtime/Basic Tasks/Quaternion/Angle.cs | 29 +++++ .../Runtime/Basic Tasks/Quaternion/Angle.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/AngleAxis.cs | 30 ++++++ .../Basic Tasks/Quaternion/AngleAxis.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Dot.cs | 29 +++++ .../Runtime/Basic Tasks/Quaternion/Dot.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Euler.cs | 27 +++++ .../Runtime/Basic Tasks/Quaternion/Euler.cs.meta | 8 ++ .../Basic Tasks/Quaternion/FromToRotation.cs | 29 +++++ .../Basic Tasks/Quaternion/FromToRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Identity.cs | 24 +++++ .../Basic Tasks/Quaternion/Identity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Inverse.cs | 26 +++++ .../Runtime/Basic Tasks/Quaternion/Inverse.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Lerp.cs | 31 ++++++ .../Runtime/Basic Tasks/Quaternion/Lerp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/LookRotation.cs | 29 +++++ .../Basic Tasks/Quaternion/LookRotation.cs.meta | 8 ++ .../Basic Tasks/Quaternion/RotateTowards.cs | 31 ++++++ .../Basic Tasks/Quaternion/RotateTowards.cs.meta | 8 ++ .../Runtime/Basic Tasks/Quaternion/Slerp.cs | 31 ++++++ .../Runtime/Basic Tasks/Quaternion/Slerp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Renderer.meta | 5 + .../Runtime/Basic Tasks/Renderer/IsVisible.cs | 40 +++++++ .../Runtime/Basic Tasks/Renderer/IsVisible.cs.meta | 8 ++ .../Runtime/Basic Tasks/Renderer/SetMaterial.cs | 44 ++++++++ .../Basic Tasks/Renderer/SetMaterial.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody.meta | 5 + .../Basic Tasks/Rigidbody/AddExplosionForce.cs | 57 ++++++++++ .../Rigidbody/AddExplosionForce.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/AddForce.cs | 51 +++++++++ .../Runtime/Basic Tasks/Rigidbody/AddForce.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/AddForceAtPosition.cs | 51 +++++++++ .../Rigidbody/AddForceAtPosition.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/AddRelativeForce.cs | 48 +++++++++ .../Basic Tasks/Rigidbody/AddRelativeForce.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/AddRelativeTorque.cs | 43 ++++++++ .../Rigidbody/AddRelativeTorque.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/AddTorque.cs | 48 +++++++++ .../Basic Tasks/Rigidbody/AddTorque.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/GetAngularDrag.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetAngularDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/GetAngularVelocity.cs | 46 ++++++++ .../Rigidbody/GetAngularVelocity.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/GetCenterOfMass.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetCenterOfMass.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetDrag.cs | 46 ++++++++ .../Runtime/Basic Tasks/Rigidbody/GetDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/GetFreezeRotation.cs | 46 ++++++++ .../Rigidbody/GetFreezeRotation.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/GetIsKinematic.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetIsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetMass.cs | 46 ++++++++ .../Runtime/Basic Tasks/Rigidbody/GetMass.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetPosition.cs | 51 +++++++++ .../Basic Tasks/Rigidbody/GetPosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetRotation.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetUseGravity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/GetVelocity.cs | 46 ++++++++ .../Basic Tasks/Rigidbody/GetVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/IsKinematic.cs | 40 +++++++ .../Basic Tasks/Rigidbody/IsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/IsSleeping.cs | 40 +++++++ .../Basic Tasks/Rigidbody/IsSleeping.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/MovePosition.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/MovePosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/MoveRotation.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/MoveRotation.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetAngularDrag.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetAngularDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetAngularVelocity.cs | 45 ++++++++ .../Rigidbody/SetAngularVelocity.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetCenterOfMass.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetCenterOfMass.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetConstraints.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetConstraints.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetDrag.cs | 45 ++++++++ .../Runtime/Basic Tasks/Rigidbody/SetDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetFreezeRotation.cs | 45 ++++++++ .../Rigidbody/SetFreezeRotation.cs.meta | 8 ++ .../Basic Tasks/Rigidbody/SetIsKinematic.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetIsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetMass.cs | 45 ++++++++ .../Runtime/Basic Tasks/Rigidbody/SetMass.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetPosition.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetPosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetRotation.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetUseGravity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/SetVelocity.cs | 45 ++++++++ .../Basic Tasks/Rigidbody/SetVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/Sleep.cs | 42 ++++++++ .../Runtime/Basic Tasks/Rigidbody/Sleep.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/UseGravity.cs | 40 +++++++ .../Basic Tasks/Rigidbody/UseGravity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody/WakeUp.cs | 42 ++++++++ .../Runtime/Basic Tasks/Rigidbody/WakeUp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D.meta | 5 + .../Runtime/Basic Tasks/Rigidbody2D/AddForce.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/AddForce.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/AddForceAtPosition.cs | 47 ++++++++ .../Rigidbody2D/AddForceAtPosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/AddTorque.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/GetAngularDrag.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetAngularDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/GetAngularVelocity.cs | 45 ++++++++ .../Rigidbody2D/GetAngularVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/GetFixedAngle.cs | 47 ++++++++ .../Basic Tasks/Rigidbody2D/GetFixedAngle.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/GetGravtyScale.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetGravtyScale.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/GetIsKinematic.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetIsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/GetMass.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetMass.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs | 50 +++++++++ .../Basic Tasks/Rigidbody2D/GetPosition.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/GetVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs | 39 +++++++ .../Basic Tasks/Rigidbody2D/IsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs | 39 +++++++ .../Basic Tasks/Rigidbody2D/IsSleeping.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/MovePosition.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/MovePosition.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/MoveRotation.cs | 45 ++++++++ .../Basic Tasks/Rigidbody2D/MoveRotation.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/SetAngularDrag.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/SetAngularDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/SetAngularVelocity.cs | 44 ++++++++ .../Rigidbody2D/SetAngularVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/SetDrag.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/SetFixedAngle.cs | 46 ++++++++ .../Basic Tasks/Rigidbody2D/SetFixedAngle.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/SetGravityScale.cs | 44 ++++++++ .../Rigidbody2D/SetGravityScale.cs.meta | 8 ++ .../Basic Tasks/Rigidbody2D/SetIsKinematic.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/SetIsKinematic.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/SetMass.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/SetMass.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs | 44 ++++++++ .../Basic Tasks/Rigidbody2D/SetVelocity.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/Sleep.cs | 41 +++++++ .../Runtime/Basic Tasks/Rigidbody2D/Sleep.cs.meta | 8 ++ .../Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs | 41 +++++++ .../Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs.meta | 8 ++ .../Runtime/Basic Tasks/SharedVariables.meta | 5 + .../SharedVariables/CompareSharedBool.cs | 25 +++++ .../SharedVariables/CompareSharedBool.cs.meta | 8 ++ .../SharedVariables/CompareSharedColor.cs | 25 +++++ .../SharedVariables/CompareSharedColor.cs.meta | 8 ++ .../SharedVariables/CompareSharedFloat.cs | 25 +++++ .../SharedVariables/CompareSharedFloat.cs.meta | 8 ++ .../SharedVariables/CompareSharedGameObject.cs | 30 ++++++ .../CompareSharedGameObject.cs.meta | 8 ++ .../SharedVariables/CompareSharedGameObjectList.cs | 33 ++++++ .../CompareSharedGameObjectList.cs.meta | 8 ++ .../SharedVariables/CompareSharedInt.cs | 25 +++++ .../SharedVariables/CompareSharedInt.cs.meta | 8 ++ .../SharedVariables/CompareSharedObject.cs | 30 ++++++ .../SharedVariables/CompareSharedObject.cs.meta | 8 ++ .../SharedVariables/CompareSharedObjectList.cs | 33 ++++++ .../CompareSharedObjectList.cs.meta | 8 ++ .../SharedVariables/CompareSharedQuaternion.cs | 25 +++++ .../CompareSharedQuaternion.cs.meta | 8 ++ .../SharedVariables/CompareSharedRect.cs | 25 +++++ .../SharedVariables/CompareSharedRect.cs.meta | 8 ++ .../SharedVariables/CompareSharedString.cs | 25 +++++ .../SharedVariables/CompareSharedString.cs.meta | 8 ++ .../SharedVariables/CompareSharedTransform.cs | 30 ++++++ .../SharedVariables/CompareSharedTransform.cs.meta | 8 ++ .../SharedVariables/CompareSharedTransformList.cs | 33 ++++++ .../CompareSharedTransformList.cs.meta | 8 ++ .../SharedVariables/CompareSharedVector2.cs | 25 +++++ .../SharedVariables/CompareSharedVector2.cs.meta | 8 ++ .../SharedVariables/CompareSharedVector3.cs | 25 +++++ .../SharedVariables/CompareSharedVector3.cs.meta | 8 ++ .../SharedVariables/CompareSharedVector4.cs | 25 +++++ .../SharedVariables/CompareSharedVector4.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedBool.cs | 28 +++++ .../SharedVariables/SetSharedBool.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedColor.cs | 28 +++++ .../SharedVariables/SetSharedColor.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedFloat.cs | 28 +++++ .../SharedVariables/SetSharedFloat.cs.meta | 8 ++ .../SharedVariables/SetSharedGameObject.cs | 28 +++++ .../SharedVariables/SetSharedGameObject.cs.meta | 8 ++ .../SharedVariables/SetSharedGameObjectList.cs | 28 +++++ .../SetSharedGameObjectList.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedInt.cs | 28 +++++ .../SharedVariables/SetSharedInt.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedObject.cs | 28 +++++ .../SharedVariables/SetSharedObject.cs.meta | 8 ++ .../SharedVariables/SetSharedObjectList.cs | 28 +++++ .../SharedVariables/SetSharedObjectList.cs.meta | 8 ++ .../SharedVariables/SetSharedQuaternion.cs | 27 +++++ .../SharedVariables/SetSharedQuaternion.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedRect.cs | 28 +++++ .../SharedVariables/SetSharedRect.cs.meta | 8 ++ .../Basic Tasks/SharedVariables/SetSharedString.cs | 28 +++++ .../SharedVariables/SetSharedString.cs.meta | 8 ++ .../SharedVariables/SetSharedTransform.cs | 28 +++++ .../SharedVariables/SetSharedTransform.cs.meta | 8 ++ .../SharedVariables/SetSharedTransformList.cs | 28 +++++ .../SharedVariables/SetSharedTransformList.cs.meta | 8 ++ .../SharedVariables/SetSharedVector2.cs | 28 +++++ .../SharedVariables/SetSharedVector2.cs.meta | 8 ++ .../SharedVariables/SetSharedVector3.cs | 28 +++++ .../SharedVariables/SetSharedVector3.cs.meta | 8 ++ .../SharedVariables/SetSharedVector4.cs | 28 +++++ .../SharedVariables/SetSharedVector4.cs.meta | 8 ++ .../SharedVariables/SharedGameObjectToTransform.cs | 32 ++++++ .../SharedGameObjectToTransform.cs.meta | 8 ++ .../SharedGameObjectsToGameObjectList.cs | 41 +++++++ .../SharedGameObjectsToGameObjectList.cs.meta | 8 ++ .../SharedVariables/SharedTransformToGameObject.cs | 32 ++++++ .../SharedTransformToGameObject.cs.meta | 8 ++ .../SharedTransformsToTransformList.cs | 41 +++++++ .../SharedTransformsToTransformList.cs.meta | 8 ++ .../Runtime/Basic Tasks/SphereCollider.meta | 5 + .../Basic Tasks/SphereCollider/GetCenter.cs | 44 ++++++++ .../Basic Tasks/SphereCollider/GetCenter.cs.meta | 8 ++ .../Basic Tasks/SphereCollider/GetRadius.cs | 45 ++++++++ .../Basic Tasks/SphereCollider/GetRadius.cs.meta | 8 ++ .../Basic Tasks/SphereCollider/SetCenter.cs | 44 ++++++++ .../Basic Tasks/SphereCollider/SetCenter.cs.meta | 8 ++ .../Basic Tasks/SphereCollider/SetRadius.cs | 44 ++++++++ .../Basic Tasks/SphereCollider/SetRadius.cs.meta | 8 ++ .../Runtime/Basic Tasks/String.meta | 5 + .../Runtime/Basic Tasks/String/BuildString.cs | 31 ++++++ .../Runtime/Basic Tasks/String/BuildString.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/CompareTo.cs | 30 ++++++ .../Runtime/Basic Tasks/String/CompareTo.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/Format.cs | 47 ++++++++ .../Runtime/Basic Tasks/String/Format.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/GetLength.cs | 27 +++++ .../Runtime/Basic Tasks/String/GetLength.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/GetRandomString.cs | 28 +++++ .../Basic Tasks/String/GetRandomString.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/GetSubstring.cs | 37 +++++++ .../Basic Tasks/String/GetSubstring.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/IsNullOrEmpty.cs | 22 ++++ .../Basic Tasks/String/IsNullOrEmpty.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/Replace.cs | 34 ++++++ .../Runtime/Basic Tasks/String/Replace.cs.meta | 8 ++ .../Runtime/Basic Tasks/String/SetString.cs | 28 +++++ .../Runtime/Basic Tasks/String/SetString.cs.meta | 8 ++ .../Runtime/Basic Tasks/Time.meta | 5 + .../Runtime/Basic Tasks/Time/GetDeltaTime.cs | 23 ++++ .../Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta | 8 ++ .../Basic Tasks/Time/GetRealtimeSinceStartup.cs | 23 ++++ .../Time/GetRealtimeSinceStartup.cs.meta | 8 ++ .../Runtime/Basic Tasks/Time/GetTime.cs | 23 ++++ .../Runtime/Basic Tasks/Time/GetTime.cs.meta | 8 ++ .../Runtime/Basic Tasks/Time/GetTimeScale.cs | 23 ++++ .../Runtime/Basic Tasks/Time/GetTimeScale.cs.meta | 8 ++ .../Runtime/Basic Tasks/Time/SetTimeScale.cs | 23 ++++ .../Runtime/Basic Tasks/Time/SetTimeScale.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform.meta | 5 + .../Runtime/Basic Tasks/Transform/Find.cs | 48 +++++++++ .../Runtime/Basic Tasks/Transform/Find.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/FindChild.cs | 48 +++++++++ .../Basic Tasks/Transform/FindChild.cs.meta | 8 ++ .../Basic Tasks/Transform/GetAngleToTarget.cs | 66 ++++++++++++ .../Basic Tasks/Transform/GetAngleToTarget.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetChild.cs | 48 +++++++++ .../Runtime/Basic Tasks/Transform/GetChild.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetChildCount.cs | 45 ++++++++ .../Basic Tasks/Transform/GetChildCount.cs.meta | 8 ++ .../Basic Tasks/Transform/GetEulerAngles.cs | 45 ++++++++ .../Basic Tasks/Transform/GetEulerAngles.cs.meta | 8 ++ .../Basic Tasks/Transform/GetForwardVector.cs | 45 ++++++++ .../Basic Tasks/Transform/GetForwardVector.cs.meta | 8 ++ .../Basic Tasks/Transform/GetLocalEulerAngles.cs | 45 ++++++++ .../Transform/GetLocalEulerAngles.cs.meta | 8 ++ .../Basic Tasks/Transform/GetLocalPosition.cs | 45 ++++++++ .../Basic Tasks/Transform/GetLocalPosition.cs.meta | 8 ++ .../Basic Tasks/Transform/GetLocalRotation.cs | 45 ++++++++ .../Basic Tasks/Transform/GetLocalRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetLocalScale.cs | 45 ++++++++ .../Basic Tasks/Transform/GetLocalScale.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetParent.cs | 45 ++++++++ .../Basic Tasks/Transform/GetParent.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetPosition.cs | 50 +++++++++ .../Basic Tasks/Transform/GetPosition.cs.meta | 8 ++ .../Basic Tasks/Transform/GetRightVector.cs | 45 ++++++++ .../Basic Tasks/Transform/GetRightVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetRotation.cs | 45 ++++++++ .../Basic Tasks/Transform/GetRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/GetUpVector.cs | 45 ++++++++ .../Basic Tasks/Transform/GetUpVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/IsChildOf.cs | 42 ++++++++ .../Basic Tasks/Transform/IsChildOf.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/LookAt.cs | 47 ++++++++ .../Runtime/Basic Tasks/Transform/LookAt.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/Rotate.cs | 47 ++++++++ .../Runtime/Basic Tasks/Transform/Rotate.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/RotateAround.cs | 50 +++++++++ .../Basic Tasks/Transform/RotateAround.cs.meta | 8 ++ .../Basic Tasks/Transform/SetEulerAngles.cs | 44 ++++++++ .../Basic Tasks/Transform/SetEulerAngles.cs.meta | 8 ++ .../Basic Tasks/Transform/SetForwardVector.cs | 44 ++++++++ .../Basic Tasks/Transform/SetForwardVector.cs.meta | 8 ++ .../Basic Tasks/Transform/SetLocalEulerAngles.cs | 44 ++++++++ .../Transform/SetLocalEulerAngles.cs.meta | 8 ++ .../Basic Tasks/Transform/SetLocalPosition.cs | 44 ++++++++ .../Basic Tasks/Transform/SetLocalPosition.cs.meta | 8 ++ .../Basic Tasks/Transform/SetLocalRotation.cs | 44 ++++++++ .../Basic Tasks/Transform/SetLocalRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/SetLocalScale.cs | 44 ++++++++ .../Basic Tasks/Transform/SetLocalScale.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/SetParent.cs | 44 ++++++++ .../Basic Tasks/Transform/SetParent.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/SetPosition.cs | 44 ++++++++ .../Basic Tasks/Transform/SetPosition.cs.meta | 8 ++ .../Basic Tasks/Transform/SetRightVector.cs | 44 ++++++++ .../Basic Tasks/Transform/SetRightVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/SetRotation.cs | 44 ++++++++ .../Basic Tasks/Transform/SetRotation.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/SetUpVector.cs | 44 ++++++++ .../Basic Tasks/Transform/SetUpVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Transform/Translate.cs | 47 ++++++++ .../Basic Tasks/Transform/Translate.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2.meta | 5 + .../Runtime/Basic Tasks/Vector2/ClampMagnitude.cs | 29 +++++ .../Basic Tasks/Vector2/ClampMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Distance.cs | 29 +++++ .../Runtime/Basic Tasks/Vector2/Distance.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Dot.cs | 29 +++++ .../Runtime/Basic Tasks/Vector2/Dot.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetMagnitude.cs | 27 +++++ .../Basic Tasks/Vector2/GetMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetRightVector.cs | 24 +++++ .../Basic Tasks/Vector2/GetRightVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs | 27 +++++ .../Basic Tasks/Vector2/GetSqrMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetUpVector.cs | 24 +++++ .../Basic Tasks/Vector2/GetUpVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetVector3.cs | 27 +++++ .../Runtime/Basic Tasks/Vector2/GetVector3.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/GetXY.cs | 31 ++++++ .../Runtime/Basic Tasks/Vector2/GetXY.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Lerp.cs | 31 ++++++ .../Runtime/Basic Tasks/Vector2/Lerp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/MoveTowards.cs | 31 ++++++ .../Basic Tasks/Vector2/MoveTowards.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Multiply.cs | 29 +++++ .../Runtime/Basic Tasks/Vector2/Multiply.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Normalize.cs | 26 +++++ .../Runtime/Basic Tasks/Vector2/Normalize.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/Operator.cs | 47 ++++++++ .../Runtime/Basic Tasks/Vector2/Operator.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/SetValue.cs | 25 +++++ .../Runtime/Basic Tasks/Vector2/SetValue.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector2/SetXY.cs | 35 ++++++ .../Runtime/Basic Tasks/Vector2/SetXY.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3.meta | 5 + .../Runtime/Basic Tasks/Vector3/Angle.cs | 29 +++++ .../Runtime/Basic Tasks/Vector3/Angle.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/ClampMagnitude.cs | 29 +++++ .../Basic Tasks/Vector3/ClampMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Distance.cs | 29 +++++ .../Runtime/Basic Tasks/Vector3/Distance.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Dot.cs | 29 +++++ .../Runtime/Basic Tasks/Vector3/Dot.cs.meta | 8 ++ .../Basic Tasks/Vector3/GetForwardVector.cs | 24 +++++ .../Basic Tasks/Vector3/GetForwardVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetMagnitude.cs | 27 +++++ .../Basic Tasks/Vector3/GetMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetRightVector.cs | 24 +++++ .../Basic Tasks/Vector3/GetRightVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs | 27 +++++ .../Basic Tasks/Vector3/GetSqrMagnitude.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetUpVector.cs | 24 +++++ .../Basic Tasks/Vector3/GetUpVector.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetVector2.cs | 27 +++++ .../Runtime/Basic Tasks/Vector3/GetVector2.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/GetXYZ.cs | 35 ++++++ .../Runtime/Basic Tasks/Vector3/GetXYZ.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Lerp.cs | 31 ++++++ .../Runtime/Basic Tasks/Vector3/Lerp.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/MoveTowards.cs | 31 ++++++ .../Basic Tasks/Vector3/MoveTowards.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Multiply.cs | 29 +++++ .../Runtime/Basic Tasks/Vector3/Multiply.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Normalize.cs | 26 +++++ .../Runtime/Basic Tasks/Vector3/Normalize.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/Operator.cs | 47 ++++++++ .../Runtime/Basic Tasks/Vector3/Operator.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/RotateTowards.cs | 33 ++++++ .../Basic Tasks/Vector3/RotateTowards.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/SetValue.cs | 25 +++++ .../Runtime/Basic Tasks/Vector3/SetValue.cs.meta | 8 ++ .../Runtime/Basic Tasks/Vector3/SetXYZ.cs | 40 +++++++ .../Runtime/Basic Tasks/Vector3/SetXYZ.cs.meta | 8 ++ .../Runtime/BehaviorDesignerRuntime.dll | Bin 0 -> 103936 bytes .../Runtime/BehaviorDesignerRuntime.dll.meta | 23 ++++ .../Behavior Designer/Runtime/BehaviorTree.cs | 11 ++ .../Behavior Designer/Runtime/BehaviorTree.cs.meta | 8 ++ .../Behavior Designer/Runtime/Composites.meta | 5 + .../Runtime/Composites/Parallel.cs | 87 +++++++++++++++ .../Runtime/Composites/Parallel.cs.meta | 8 ++ .../Runtime/Composites/ParallelSelector.cs | 87 +++++++++++++++ .../Runtime/Composites/ParallelSelector.cs.meta | 8 ++ .../Runtime/Composites/PrioritySelector.cs | 72 +++++++++++++ .../Runtime/Composites/PrioritySelector.cs.meta | 8 ++ .../Runtime/Composites/RandomSelector.cs | 102 ++++++++++++++++++ .../Runtime/Composites/RandomSelector.cs.meta | 8 ++ .../Runtime/Composites/RandomSequence.cs | 103 ++++++++++++++++++ .../Runtime/Composites/RandomSequence.cs.meta | 8 ++ .../Runtime/Composites/Selector.cs | 46 ++++++++ .../Runtime/Composites/Selector.cs.meta | 8 ++ .../Runtime/Composites/SelectorEvaluator.cs | 120 +++++++++++++++++++++ .../Runtime/Composites/SelectorEvaluator.cs.meta | 8 ++ .../Runtime/Composites/Sequence.cs | 46 ++++++++ .../Runtime/Composites/Sequence.cs.meta | 8 ++ .../Behavior Designer/Runtime/Conditionals.meta | 5 + .../Runtime/Conditionals/HasReceivedEvent.cs | 102 ++++++++++++++++++ .../Runtime/Conditionals/HasReceivedEvent.cs.meta | 8 ++ .../Runtime/Conditionals/Physics.meta | 5 + .../Conditionals/Physics/HasEnteredCollision.cs | 41 +++++++ .../Physics/HasEnteredCollision.cs.meta | 8 ++ .../Conditionals/Physics/HasEnteredCollision2D.cs | 41 +++++++ .../Physics/HasEnteredCollision2D.cs.meta | 8 ++ .../Conditionals/Physics/HasEnteredTrigger.cs | 41 +++++++ .../Conditionals/Physics/HasEnteredTrigger.cs.meta | 8 ++ .../Conditionals/Physics/HasEnteredTrigger2D.cs | 41 +++++++ .../Physics/HasEnteredTrigger2D.cs.meta | 8 ++ .../Conditionals/Physics/HasExitedCollision.cs | 40 +++++++ .../Physics/HasExitedCollision.cs.meta | 8 ++ .../Conditionals/Physics/HasExitedCollision2D.cs | 41 +++++++ .../Physics/HasExitedCollision2D.cs.meta | 8 ++ .../Conditionals/Physics/HasExitedTrigger.cs | 41 +++++++ .../Conditionals/Physics/HasExitedTrigger.cs.meta | 8 ++ .../Conditionals/Physics/HasExitedTrigger2D.cs | 41 +++++++ .../Physics/HasExitedTrigger2D.cs.meta | 8 ++ .../Runtime/Conditionals/RandomProbability.cs | 46 ++++++++ .../Runtime/Conditionals/RandomProbability.cs.meta | 8 ++ .../Runtime/Conditionals/Reflection.meta | 5 + .../Conditionals/Reflection/CompareFieldValue.cs | 61 +++++++++++ .../Reflection/CompareFieldValue.cs.meta | 8 ++ .../Reflection/ComparePropertyValue.cs | 61 +++++++++++ .../Reflection/ComparePropertyValue.cs.meta | 8 ++ .../Behavior Designer/Runtime/Decorators.meta | 5 + .../Runtime/Decorators/ConditionalEvaluator.cs | 104 ++++++++++++++++++ .../Decorators/ConditionalEvaluator.cs.meta | 8 ++ .../Runtime/Decorators/Interrupt.cs | 49 +++++++++ .../Runtime/Decorators/Interrupt.cs.meta | 8 ++ .../Runtime/Decorators/Inverter.cs | 41 +++++++ .../Runtime/Decorators/Inverter.cs.meta | 8 ++ .../Runtime/Decorators/Repeater.cs | 48 +++++++++ .../Runtime/Decorators/Repeater.cs.meta | 8 ++ .../Runtime/Decorators/ReturnFailure.cs | 39 +++++++ .../Runtime/Decorators/ReturnFailure.cs.meta | 8 ++ .../Runtime/Decorators/ReturnSuccess.cs | 38 +++++++ .../Runtime/Decorators/ReturnSuccess.cs.meta | 8 ++ .../Runtime/Decorators/TaskGuard.cs | 77 +++++++++++++ .../Runtime/Decorators/TaskGuard.cs.meta | 8 ++ .../Runtime/Decorators/UntilFailure.cs | 29 +++++ .../Runtime/Decorators/UntilFailure.cs.meta | 8 ++ .../Runtime/Decorators/UntilSuccess.cs | 29 +++++ .../Runtime/Decorators/UntilSuccess.cs.meta | 8 ++ .../Assets/Behavior Designer/Runtime/EntryTask.cs | 16 +++ .../Behavior Designer/Runtime/EntryTask.cs.meta | 8 ++ .../Runtime/ExternalBehaviorTree.cs | 11 ++ .../Runtime/ExternalBehaviorTree.cs.meta | 8 ++ .../Behavior Designer/Runtime/Object Drawers.meta | 5 + .../Runtime/Object Drawers/FloatSliderAttribute.cs | 16 +++ .../Object Drawers/FloatSliderAttribute.cs.meta | 8 ++ .../Runtime/Object Drawers/IntSliderAttribute.cs | 16 +++ .../Object Drawers/IntSliderAttribute.cs.meta | 8 ++ .../Behavior Designer/Runtime/Variables.meta | 5 + .../Runtime/Variables/SharedBool.cs | 11 ++ .../Runtime/Variables/SharedBool.cs.meta | 8 ++ .../Runtime/Variables/SharedColor.cs | 11 ++ .../Runtime/Variables/SharedColor.cs.meta | 8 ++ .../Runtime/Variables/SharedFloat.cs | 8 ++ .../Runtime/Variables/SharedFloat.cs.meta | 8 ++ .../Runtime/Variables/SharedGameObject.cs | 11 ++ .../Runtime/Variables/SharedGameObject.cs.meta | 8 ++ .../Runtime/Variables/SharedGameObjectList.cs | 11 ++ .../Runtime/Variables/SharedGameObjectList.cs.meta | 8 ++ .../Runtime/Variables/SharedInt.cs | 11 ++ .../Runtime/Variables/SharedInt.cs.meta | 8 ++ .../Runtime/Variables/SharedMaterial.cs | 10 ++ .../Runtime/Variables/SharedMaterial.cs.meta | 8 ++ .../Runtime/Variables/SharedObject.cs | 11 ++ .../Runtime/Variables/SharedObject.cs.meta | 8 ++ .../Runtime/Variables/SharedObjectList.cs | 11 ++ .../Runtime/Variables/SharedObjectList.cs.meta | 8 ++ .../Runtime/Variables/SharedQuaternion.cs | 11 ++ .../Runtime/Variables/SharedQuaternion.cs.meta | 8 ++ .../Runtime/Variables/SharedRect.cs | 11 ++ .../Runtime/Variables/SharedRect.cs.meta | 8 ++ .../Runtime/Variables/SharedString.cs | 11 ++ .../Runtime/Variables/SharedString.cs.meta | 8 ++ .../Runtime/Variables/SharedTransform.cs | 11 ++ .../Runtime/Variables/SharedTransform.cs.meta | 8 ++ .../Runtime/Variables/SharedTransformList.cs | 11 ++ .../Runtime/Variables/SharedTransformList.cs.meta | 8 ++ .../Runtime/Variables/SharedVector2.cs | 11 ++ .../Runtime/Variables/SharedVector2.cs.meta | 8 ++ .../Runtime/Variables/SharedVector3.cs | 11 ++ .../Runtime/Variables/SharedVector3.cs.meta | 8 ++ .../Runtime/Variables/SharedVector4.cs | 11 ++ .../Runtime/Variables/SharedVector4.cs.meta | 8 ++ 1055 files changed, 24363 insertions(+) create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Log.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Log.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll create mode 100644 Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/EntryTask.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/EntryTask.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Object Drawers.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs.meta create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs create mode 100644 Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs.meta (limited to 'Client/Assets/Behavior Designer/Runtime') diff --git a/Client/Assets/Behavior Designer/Runtime/Actions.meta b/Client/Assets/Behavior Designer/Runtime/Actions.meta new file mode 100644 index 00000000..f339ca92 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 45c329b28adc8de439b3ee381ccc759b +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs b/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs new file mode 100644 index 00000000..5bf87b40 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs @@ -0,0 +1,17 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + // Wrapper class for the Behavior Reference task. The Behavior Tree Reference task allows you to run another behavior tree within the current behavior tree. + // One use for this task is if you have an unit that plays a series of tasks to attack. You may want the unit to attack at different points within + // the behavior tree, and you want that attack to always be the same. Instead of copying and pasting the same tasks over and over you can just use + // an external behavior and then the tasks are always guaranteed to be the same. This example is demonstrated in the RTS sample project located at + // http://www.opsive.com/assets/BehaviorDesigner/samples.php. + [TaskDescription("Behavior Tree Reference allows you to run another behavior tree within the current behavior tree.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=53")] + [TaskIcon("BehaviorTreeReferenceIcon.png")] + public class BehaviorTreeReference : BehaviorReference + { + // intentionally left blank - subclass of BehaviorReference + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs.meta new file mode 100644 index 00000000..f81a791a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/BehaviorTreeReference.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af7b6fcbc7258f34aad1bb82b5b3fdc8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs new file mode 100644 index 00000000..04574a79 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs @@ -0,0 +1,15 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns a TaskStatus of running. Will only stop when interrupted or a conditional abort is triggered.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=112")] + [TaskIcon("{SkinColor}IdleIcon.png")] + public class Idle : Action + { + public override TaskStatus OnUpdate() + { + return TaskStatus.Running; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs.meta new file mode 100644 index 00000000..6b5a4977 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Idle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 759252a4ffada80419ef06ce1c625246 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs new file mode 100644 index 00000000..b3ce1f2a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Log is a simple task which will output the specified text and return success. It can be used for debugging.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=16")] + [TaskIcon("{SkinColor}LogIcon.png")] + public class Log : Action + { + [Tooltip("Text to output to the log")] + public SharedString text; + [Tooltip("Is this text an error?")] + public SharedBool logError; + + public override TaskStatus OnUpdate() + { + // Log the text and return success + //if (logError.Value) { + // Debug.LogError(text); + //} else { + // Debug.Log(text); + //} + return TaskStatus.Success; + } + + public override void OnReset() + { + // Reset the properties back to their original values + text = ""; + logError = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs.meta new file mode 100644 index 00000000..31b9601b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Log.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d53794347878c7c479da37533dce2024 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs b/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs new file mode 100644 index 00000000..05c20a68 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs @@ -0,0 +1,29 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Perform the actual interruption. This will immediately stop the specified tasks from running and will return success or failure depending on the value of interrupt success.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=17")] + [TaskIcon("{SkinColor}PerformInterruptionIcon.png")] + public class PerformInterruption : Action + { + [Tooltip("The list of tasks to interrupt. Can be any number of tasks")] + public Interrupt[] interruptTasks; + [Tooltip("When we interrupt the task should we return a task status of success?")] + public SharedBool interruptSuccess; + + public override TaskStatus OnUpdate() + { + // Loop through all of the tasks and fire an interruption. Once complete return success. + for (int i = 0; i < interruptTasks.Length; ++i) { + interruptTasks[i].DoInterrupt(interruptSuccess.Value ? TaskStatus.Success : TaskStatus.Failure); + } + return TaskStatus.Success; + } + + public override void OnReset() + { + // Reset the properties back to their original values. + interruptTasks = null; + interruptSuccess = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs.meta new file mode 100644 index 00000000..028b3699 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/PerformInterruption.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72d2d6051b23e86468e2f715f044dad8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection.meta new file mode 100644 index 00000000..ee7a8834 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 70f925868ab5ebe4cbc702810c2c5857 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs new file mode 100644 index 00000000..1a4631a1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs @@ -0,0 +1,58 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Gets the value from the field specified. Returns success if the field was retrieved.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=147")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class GetFieldValue : Action + { + [Tooltip("The GameObject to get the field on")] + public SharedGameObject targetGameObject; + [Tooltip("The component to get the field on")] + public SharedString componentName; + [Tooltip("The name of the field")] + public SharedString fieldName; + [Tooltip("The value of the field")] + [RequiredField] + public SharedVariable fieldValue; + + public override TaskStatus OnUpdate() + { + if (fieldValue == null) { + //Debug.LogWarning("Unable to get field - field value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + //Debug.LogWarning("Unable to get field - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + //Debug.LogWarning("Unable to get the field with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var field = component.GetType().GetField(fieldName.Value); + fieldValue.SetValue(field.GetValue(component)); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + fieldName = null; + fieldValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs.meta new file mode 100644 index 00000000..34bf75c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetFieldValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc317dd7feb2085499edb0d0c4604640 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs new file mode 100644 index 00000000..63e50c26 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs @@ -0,0 +1,58 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Gets the value from the property specified. Returns success if the property was retrieved.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=148")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class GetPropertyValue : Action + { + [Tooltip("The GameObject to get the property of")] + public SharedGameObject targetGameObject; + [Tooltip("The component to get the property of")] + public SharedString componentName; + [Tooltip("The name of the property")] + public SharedString propertyName; + [Tooltip("The value of the property")] + [RequiredField] + public SharedVariable propertyValue; + + public override TaskStatus OnUpdate() + { + if (propertyValue == null) { + //Debug.LogWarning("Unable to get property - property value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + //Debug.LogWarning("Unable to get property - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + //Debug.LogWarning("Unable to get the property with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var property = component.GetType().GetProperty(propertyName.Value); + propertyValue.SetValue(property.GetValue(component, null)); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + propertyName = null; + propertyValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs.meta new file mode 100644 index 00000000..587385b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/GetPropertyValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dda9c9b7c6ff2ee4f95a2e208cddae64 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs new file mode 100644 index 00000000..5780c350 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs @@ -0,0 +1,86 @@ +using UnityEngine; +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Invokes the specified method with the specified parameters. Can optionally store the return value. Returns success if the method was invoked.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=145")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class InvokeMethod : Action + { + [Tooltip("The GameObject to invoke the method on")] + public SharedGameObject targetGameObject; + [Tooltip("The component to invoke the method on")] + public SharedString componentName; + [Tooltip("The name of the method")] + public SharedString methodName; + [Tooltip("The first parameter of the method")] + public SharedVariable parameter1; + [Tooltip("The second parameter of the method")] + public SharedVariable parameter2; + [Tooltip("The third parameter of the method")] + public SharedVariable parameter3; + [Tooltip("The fourth parameter of the method")] + public SharedVariable parameter4; + [Tooltip("Store the result of the invoke call")] + public SharedVariable storeResult; + + public override TaskStatus OnUpdate() + { + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + //Debug.LogWarning("Unable to invoke - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + //Debug.LogWarning("Unable to invoke method with component " + componentName.Value); + return TaskStatus.Failure; + } + + var parameterList = new List(); + var parameterTypeList = new List(); + SharedVariable sharedVariable = null; + for (int i = 0; i < 4; ++i) { + var parameterField = GetType().GetField("parameter" + (i + 1)); + if ((sharedVariable = parameterField.GetValue(this) as SharedVariable) != null) { + parameterList.Add(sharedVariable.GetValue()); + parameterTypeList.Add(sharedVariable.GetType().GetProperty("Value").PropertyType); + } else { + break; + } + } + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var methodInfo = component.GetType().GetMethod(methodName.Value, parameterTypeList.ToArray()); + + if (methodInfo == null) { + //Debug.LogWarning("Unable to invoke method " + methodName.Value + " on component " + componentName.Value); + return TaskStatus.Failure; + } + + var result = methodInfo.Invoke(component, parameterList.ToArray()); + if (storeResult != null) { + storeResult.SetValue(result); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + methodName = null; + parameter1 = null; + parameter2 = null; + parameter3 = null; + parameter4 = null; + storeResult = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs.meta new file mode 100644 index 00000000..eed4a86a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/InvokeMethod.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 359bd67578f53034ab2eb00e7696d317 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs new file mode 100644 index 00000000..c0c9e2f0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs @@ -0,0 +1,57 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Sets the field to the value specified. Returns success if the field was set.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=149")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class SetFieldValue : Action + { + [Tooltip("The GameObject to set the field on")] + public SharedGameObject targetGameObject; + [Tooltip("The component to set the field on")] + public SharedString componentName; + [Tooltip("The name of the field")] + public SharedString fieldName; + [Tooltip("The value to set")] + public SharedVariable fieldValue; + + public override TaskStatus OnUpdate() + { + if (fieldValue == null) { + //Debug.LogWarning("Unable to get field - field value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + //Debug.LogWarning("Unable to set field - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + //Debug.LogWarning("Unable to set the field with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var field = component.GetType().GetField(fieldName.Value); + field.SetValue(component, fieldValue.GetValue()); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + fieldName = null; + fieldValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs.meta new file mode 100644 index 00000000..433a991c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetFieldValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21e389787213ba24ab1a6817def634ae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs new file mode 100644 index 00000000..570aefb0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs @@ -0,0 +1,57 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Sets the property to the value specified. Returns success if the property was set.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=150")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class SetPropertyValue : Action + { + [Tooltip("The GameObject to set the property on")] + public SharedGameObject targetGameObject; + [Tooltip("The component to set the property on")] + public SharedString componentName; + [Tooltip("The name of the property")] + public SharedString propertyName; + [Tooltip("The value to set")] + public SharedVariable propertyValue; + + public override TaskStatus OnUpdate() + { + if (propertyValue == null) { + //Debug.LogWarning("Unable to get field - field value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + //Debug.LogWarning("Unable to set property - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + //Debug.LogWarning("Unable to set the property with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var property = component.GetType().GetProperty(propertyName.Value); + property.SetValue(component, propertyValue.GetValue(), null); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + propertyName = null; + propertyValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs.meta new file mode 100644 index 00000000..012823b6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Reflection/SetPropertyValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d98b13b7ae4b36b4092b439731466d9b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs new file mode 100644 index 00000000..a63d9e6c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs @@ -0,0 +1,56 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Restarts a behavior tree, returns success after it has been restarted.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=66")] + [TaskIcon("{SkinColor}RestartBehaviorTreeIcon.png")] + public class RestartBehaviorTree : Action + { + [Tooltip("The GameObject of the behavior tree that should be restarted. If null use the current behavior")] + public SharedGameObject behaviorGameObject; + [Tooltip("The group of the behavior tree that should be restarted")] + public SharedInt group; + + private Behavior behavior; + + public override void OnAwake() + { + var behaviorTrees = GetDefaultGameObject(behaviorGameObject.Value).GetComponents(); + if (behaviorTrees.Length == 1) { + behavior = behaviorTrees[0]; + } else if (behaviorTrees.Length > 1) { + for (int i = 0; i < behaviorTrees.Length; ++i) { + if (behaviorTrees[i].Group == group.Value) { + behavior = behaviorTrees[i]; + break; + } + } + // If the group can't be found then use the first behavior tree + if (behavior == null) { + behavior = behaviorTrees[0]; + } + } + } + + public override TaskStatus OnUpdate() + { + if (behavior == null) { + return TaskStatus.Failure; + } + + // Stop the behavior tree + behavior.DisableBehavior(); + // Start the behavior tree back up + behavior.EnableBehavior(); + // Return success + return TaskStatus.Success; + } + + public override void OnReset() + { + // Reset the properties back to their original values. + behavior = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs.meta new file mode 100644 index 00000000..d1110668 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/RestartBehaviorTree.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2765e7ece98046542880a1249b87e096 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs b/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs new file mode 100644 index 00000000..76007309 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs @@ -0,0 +1,73 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Sends an event to the behavior tree, returns success after sending the event.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=121")] + [TaskIcon("{SkinColor}SendEventIcon.png")] + public class SendEvent : Action + { + [Tooltip("The GameObject of the behavior tree that should have the event sent to it. If null use the current behavior")] + public SharedGameObject targetGameObject; + [Tooltip("The event to send")] + public SharedString eventName; + [Tooltip("The group of the behavior tree that the event should be sent to")] + public SharedInt group; + [Tooltip("Optionally specify a first argument to send")] + [SharedRequired] + public SharedVariable argument1; + [Tooltip("Optionally specify a second argument to send")] + [SharedRequired] + public SharedVariable argument2; + [Tooltip("Optionally specify a third argument to send")] + [SharedRequired] + public SharedVariable argument3; + + private BehaviorTree behaviorTree; + + public override void OnStart() + { + var behaviorTrees = GetDefaultGameObject(targetGameObject.Value).GetComponents(); + if (behaviorTrees.Length == 1) { + behaviorTree = behaviorTrees[0]; + } else if (behaviorTrees.Length > 1) { + for (int i = 0; i < behaviorTrees.Length; ++i) { + if (behaviorTrees[i].Group == group.Value) { + behaviorTree = behaviorTrees[i]; + break; + } + } + // If the group can't be found then use the first behavior tree + if (behaviorTree == null) { + behaviorTree = behaviorTrees[0]; + } + } + } + + public override TaskStatus OnUpdate() + { + // Send the event and return success + if (argument1 == null || argument1.IsNone) { + behaviorTree.SendEvent(eventName.Value); + } else { + if (argument2 == null || argument2.IsNone) { + behaviorTree.SendEvent(eventName.Value, argument1.GetValue()); + } else { + if (argument3 == null || argument3.IsNone) { + behaviorTree.SendEvent(eventName.Value, argument1.GetValue(), argument2.GetValue()); + } else { + behaviorTree.SendEvent(eventName.Value, argument1.GetValue(), argument2.GetValue(), argument3.GetValue()); + } + } + } + return TaskStatus.Success; + } + + public override void OnReset() + { + // Reset the properties back to their original values + targetGameObject = null; + eventName = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs.meta new file mode 100644 index 00000000..82bd42cd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/SendEvent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 53b90428a37913c40b6d415ced4e12f9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs new file mode 100644 index 00000000..e817713a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs @@ -0,0 +1,90 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Start a new behavior tree and return success after it has been started.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=20")] + [TaskIcon("{SkinColor}StartBehaviorTreeIcon.png")] + public class StartBehaviorTree : Action + { + [Tooltip("The GameObject of the behavior tree that should be started. If null use the current behavior")] + public SharedGameObject behaviorGameObject; + [Tooltip("The group of the behavior tree that should be started")] + public SharedInt group; + [Tooltip("Should this task wait for the behavior tree to complete?")] + public SharedBool waitForCompletion = false; + [Tooltip("Should the variables be synchronized?")] + public SharedBool synchronizeVariables; + + private bool behaviorComplete; + private Behavior behavior; + + public override void OnStart() + { + var behaviorTrees = GetDefaultGameObject(behaviorGameObject.Value).GetComponents(); + if (behaviorTrees.Length == 1) { + behavior = behaviorTrees[0]; + } else if (behaviorTrees.Length > 1) { + for (int i = 0; i < behaviorTrees.Length; ++i) { + if (behaviorTrees[i].Group == group.Value) { + behavior = behaviorTrees[i]; + break; + } + } + // If the group can't be found then use the first behavior tree + if (behavior == null) { + behavior = behaviorTrees[0]; + } + } + + if (behavior != null) { + var variables = Owner.GetAllVariables(); + for (int i = 0; i < variables.Count; ++i) { + behavior.SetVariable(variables[i].Name, variables[i]); + } + + behavior.EnableBehavior(); + + if (waitForCompletion.Value) { + behaviorComplete = false; + behavior.OnBehaviorEnd += BehaviorEnded; + } + } + } + + public override TaskStatus OnUpdate() + { + if (behavior == null) { + return TaskStatus.Failure; + } + + // Return a status of running if we are waiting for the behavior tree to end and it hasn't ended yet + if (waitForCompletion.Value && !behaviorComplete) { + return TaskStatus.Running; + } + + return TaskStatus.Success; + } + + private void BehaviorEnded() + { + behaviorComplete = true; + } + + public override void OnEnd() + { + if (behavior != null && waitForCompletion.Value) { + behavior.OnBehaviorEnd -= BehaviorEnded; + } + } + + public override void OnReset() + { + // Reset the properties back to their original values. + behaviorGameObject = null; + group = 0; + waitForCompletion = false; + synchronizeVariables = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs.meta new file mode 100644 index 00000000..e62076c2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc3d67c80371297439385b30f4be506c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs new file mode 100644 index 00000000..fe753c5b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs @@ -0,0 +1,57 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Pause or disable a behavior tree and return success after it has been stopped.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=21")] + [TaskIcon("{SkinColor}StopBehaviorTreeIcon.png")] + public class StopBehaviorTree : Action + { + [Tooltip("The GameObject of the behavior tree that should be stopped. If null use the current behavior")] + public SharedGameObject behaviorGameObject; + [Tooltip("The group of the behavior tree that should be stopped")] + public SharedInt group; + [Tooltip("Should the behavior be paused or completely disabled")] + public SharedBool pauseBehavior = false; + + private Behavior behavior; + + public override void OnStart() + { + var behaviorTrees = GetDefaultGameObject(behaviorGameObject.Value).GetComponents(); + if (behaviorTrees.Length == 1) { + behavior = behaviorTrees[0]; + } else if (behaviorTrees.Length > 1) { + for (int i = 0; i < behaviorTrees.Length; ++i) { + if (behaviorTrees[i].Group == group.Value) { + behavior = behaviorTrees[i]; + break; + } + } + // If the group can't be found then use the first behavior tree + if (behavior == null) { + behavior = behaviorTrees[0]; + } + } + } + + public override TaskStatus OnUpdate() + { + if (behavior == null) { + return TaskStatus.Failure; + } + + // Start the behavior and return success. + behavior.DisableBehavior(pauseBehavior.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + // Reset the properties back to their original values + behaviorGameObject = null; + group = 0; + pauseBehavior = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs.meta new file mode 100644 index 00000000..6f958c5e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/StopBehaviorTree.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 130afc7e6aa6e0c4aba29097334aa66b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs b/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs new file mode 100644 index 00000000..41f77a21 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs @@ -0,0 +1,67 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Wait a specified amount of time. The task will return running until the task is done waiting. It will return success after the wait time has elapsed.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=22")] + [TaskIcon("{SkinColor}WaitIcon.png")] + public class Wait : Action + { + [Tooltip("The amount of time to wait")] + public SharedFloat waitTime = 1; + [Tooltip("Should the wait be randomized?")] + public SharedBool randomWait = false; + [Tooltip("The minimum wait time if random wait is enabled")] + public SharedFloat randomWaitMin = 1; + [Tooltip("The maximum wait time if random wait is enabled")] + public SharedFloat randomWaitMax = 1; + + // The time to wait + private float waitDuration; + // The time that the task started to wait. + private float startTime; + // Remember the time that the task is paused so the time paused doesn't contribute to the wait time. + private float pauseTime; + + public override void OnStart() + { + // Remember the start time. + startTime = Time.time; + if (randomWait.Value) { + waitDuration = Random.Range(randomWaitMin.Value, randomWaitMax.Value); + } else { + waitDuration = waitTime.Value; + } + } + + public override TaskStatus OnUpdate() + { + // The task is done waiting if the time waitDuration has elapsed since the task was started. + if (startTime + waitDuration < Time.time) { + return TaskStatus.Success; + } + // Otherwise we are still waiting. + return TaskStatus.Running; + } + + public override void OnPause(bool paused) + { + if (paused) { + // Remember the time that the behavior was paused. + pauseTime = Time.time; + } else { + // Add the difference between Time.time and pauseTime to figure out a new start time. + startTime += (Time.time - pauseTime); + } + } + + public override void OnReset() + { + // Reset the public properties back to their original values + waitTime = 1; + randomWait = false; + randomWaitMin = 1; + randomWaitMax = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs.meta b/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs.meta new file mode 100644 index 00000000..85bfa79a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Actions/Wait.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67824d2e00531d84db9973773e4426e9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks.meta new file mode 100644 index 00000000..3bf58b0d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: de0476b4548c1d4408860e4ee2dd9471 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation.meta new file mode 100644 index 00000000..2291cfd0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: fa1395121fbad8b40934c69350e58065 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs new file mode 100644 index 00000000..18b15029 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Blends the animation. Returns Success.")] + public class Blend : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + [Tooltip("The weight the animation should blend to")] + public float targetWeight = 1; + [Tooltip("The amount of time it takes to blend")] + public float fadeLength = 0.3f; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.Blend(animationName.Value, targetWeight, fadeLength); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName = ""; + targetWeight = 1; + fadeLength = 0.3f; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs.meta new file mode 100644 index 00000000..191ac404 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Blend.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc0640154eb6b674e89f4a2ec1632696 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs new file mode 100644 index 00000000..759ad6d8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Fades the animation over a period of time and fades other animations out. Returns Success.")] + public class CrossFade : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + [Tooltip("The amount of time it takes to blend")] + public float fadeLength = 0.3f; + [Tooltip("The play mode of the animation")] + public PlayMode playMode = PlayMode.StopSameLayer; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.CrossFade(animationName.Value, fadeLength, playMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + fadeLength = 0.3f; + playMode = PlayMode.StopSameLayer; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs.meta new file mode 100644 index 00000000..dd091e17 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 57d9d1509d13e454caae6f3219c83cc7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs new file mode 100644 index 00000000..67973730 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs @@ -0,0 +1,54 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Cross fades an animation after previous animations has finished playing. Returns Success.")] + public class CrossFadeQueued : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + [Tooltip("The amount of time it takes to blend")] + public float fadeLength = 0.3f; + [Tooltip("Specifies when the animation should start playing")] + public QueueMode queue = QueueMode.CompleteOthers; + [Tooltip("The play mode of the animation")] + public PlayMode playMode = PlayMode.StopSameLayer; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.CrossFadeQueued(animationName.Value, fadeLength, queue, playMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + fadeLength = 0.3f; + queue = QueueMode.CompleteOthers; + playMode = PlayMode.StopSameLayer; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs.meta new file mode 100644 index 00000000..fda00b91 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/CrossFadeQueued.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1cc2a160ee1978488696564200b3c25 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs new file mode 100644 index 00000000..3d832dfd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Stores the animate physics value. Returns Success.")] + public class GetAnimatePhysics : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Are the if animations are executed in the physics loop?")] + [RequiredField] + public SharedBool storeValue; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animation.animatePhysics; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs.meta new file mode 100644 index 00000000..4bb05d26 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/GetAnimatePhysics.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5bd2b0ed07f42142934568bd6813619 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs new file mode 100644 index 00000000..07b99732 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Returns Success if the animation is currently playing.")] + public class IsPlaying : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + if (string.IsNullOrEmpty(animationName.Value)) { + return animation.isPlaying ? TaskStatus.Success : TaskStatus.Failure; + } else { + return animation.IsPlaying(animationName.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs.meta new file mode 100644 index 00000000..ac35dc24 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/IsPlaying.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce80475167d230d4181baa69071465ff +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs new file mode 100644 index 00000000..45c014b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs @@ -0,0 +1,52 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Plays animation without any blending. Returns Success.")] + public class Play : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + [Tooltip("The play mode of the animation")] + public PlayMode playMode = PlayMode.StopSameLayer; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + if (string.IsNullOrEmpty(animationName.Value)) { + animation.Play(); + } else { + animation.Play(animationName.Value, playMode); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + playMode = PlayMode.StopSameLayer; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs.meta new file mode 100644 index 00000000..b89dbdf0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Play.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b1bf3b05e79dcc468cf71b63d54a4cd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs new file mode 100644 index 00000000..b6d7a543 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Plays an animation after previous animations has finished playing. Returns Success.")] + public class PlayQueued : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + [Tooltip("Specifies when the animation should start playing")] + public QueueMode queue = QueueMode.CompleteOthers; + [Tooltip("The play mode of the animation")] + public PlayMode playMode = PlayMode.StopSameLayer; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.PlayQueued(animationName.Value, queue, playMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + queue = QueueMode.CompleteOthers; + playMode = PlayMode.StopSameLayer; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs.meta new file mode 100644 index 00000000..5a578270 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/PlayQueued.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb55ee97bf8cb3d479de025d77a9c4b6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs new file mode 100644 index 00000000..f870f50f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Rewinds an animation. Rewinds all animations if animationName is blank. Returns Success.")] + public class Rewind : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + if (string.IsNullOrEmpty(animationName.Value)) { + animation.Rewind(); + } else { + animation.Rewind(animationName.Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName.Value = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs.meta new file mode 100644 index 00000000..29a969f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Rewind.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 364beb9f6996556449b9f3e03db75290 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs new file mode 100644 index 00000000..5b62e126 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Samples animations at the current state. Returns Success.")] + public class Sample : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.Sample(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs.meta new file mode 100644 index 00000000..ebb26237 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Sample.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2cc64c997b5d6e640af8cc9bd7cf1b5d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs new file mode 100644 index 00000000..584ad984 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Sets animate physics to the specified value. Returns Success.")] + public class SetAnimatePhysics : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Are animations executed in the physics loop?")] + public SharedBool animatePhysics; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.animatePhysics = animatePhysics.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animatePhysics.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs.meta new file mode 100644 index 00000000..dda3f075 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetAnimatePhysics.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f93fd0c7638add0468744d4f7249c1a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs new file mode 100644 index 00000000..d17c4508 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Sets the wrap mode to the specified value. Returns Success.")] + public class SetWrapMode : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("How should time beyond the playback range of the clip be treated?")] + public WrapMode wrapMode = WrapMode.Default; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + animation.wrapMode = wrapMode; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + wrapMode = WrapMode.Default; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs.meta new file mode 100644 index 00000000..7b815d1d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/SetWrapMode.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 39af69a1e220fc2419a5d34933029ff9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs new file mode 100644 index 00000000..138de081 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimation +{ + [TaskCategory("Basic/Animation")] + [TaskDescription("Stops an animation. Stops all animations if animationName is blank. Returns Success.")] + public class Stop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the animation")] + public SharedString animationName; + + // cache the animation component + private Animation animation; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animation = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animation == null) { + //Debug.LogWarning("Animation is null"); + return TaskStatus.Failure; + } + + if (string.IsNullOrEmpty(animationName.Value)) { + animation.Stop(); + } else { + animation.Stop(animationName.Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + animationName = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs.meta new file mode 100644 index 00000000..8edc170a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animation/Stop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3dca423f03e936449fdb622cac3f430 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator.meta new file mode 100644 index 00000000..16d15aef --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 0b46617b2906c0049b19ab613fae2882 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs new file mode 100644 index 00000000..0e2e3eb7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs @@ -0,0 +1,53 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Creates a dynamic transition between the current state and the destination state. Returns Success.")] + public class CrossFade : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the state")] + public SharedString stateName; + [Tooltip("The duration of the transition. Value is in source state normalized time")] + public SharedFloat transitionDuration; + [Tooltip("The layer where the state is")] + public int layer = -1; + [Tooltip("The normalized time at which the state will play")] + public float normalizedTime = float.NegativeInfinity; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.CrossFade(stateName.Value, transitionDuration.Value, layer, normalizedTime); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + stateName = ""; + transitionDuration = 0; + layer = -1; + normalizedTime = float.NegativeInfinity; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs.meta new file mode 100644 index 00000000..d67ad7da --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/CrossFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 09e5aba2adc719f42876293bcbea7819 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs new file mode 100644 index 00000000..610a4b4e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores if root motion is applied. Returns Success.")] + public class GetApplyRootMotion : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Is root motion applied?")] + [RequiredField] + public SharedBool storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.applyRootMotion; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs.meta new file mode 100644 index 00000000..de18f15c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetApplyRootMotion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 872c96b3950799546863110b7e54d0c8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs new file mode 100644 index 00000000..5aeef328 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the bool parameter on an animator. Returns Success.")] + public class GetBoolParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the bool parameter")] + [RequiredField] + public SharedBool storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.GetBool(paramaterName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs.meta new file mode 100644 index 00000000..daf50ea0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetBoolParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2aeb7ebc08541794aa3ed0343c49c9f9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs new file mode 100644 index 00000000..df97d7ca --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs @@ -0,0 +1,50 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Gets the current state hash. Returns Success.")] + public class GetCurrentAnimatorStateNameHash : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The layer to operate on")] + public SharedInt layerIndex; + [Tooltip("The current state hash")] + [RequiredField] + public SharedInt storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.GetCurrentAnimatorStateInfo(layerIndex.Value).nameHash; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + layerIndex = 0; + storeValue = 0; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs.meta new file mode 100644 index 00000000..206d8fd2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetCurrentAnimatorStateNameHash.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2c0de75c64a6b6f4b8ef18423f1dc36d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs new file mode 100644 index 00000000..7d39667f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Gets the avatar delta position for the last evaluated frame. Returns Success.")] + public class GetDeltaPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The avatar delta position")] + [RequiredField] + public SharedVector3 storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.deltaPosition; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs.meta new file mode 100644 index 00000000..472f73da --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c44c26d5d6b3484397b8aa6ed658b1e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs new file mode 100644 index 00000000..023e1c3b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Gets the avatar delta rotation for the last evaluated frame. Returns Success.")] + public class GetDeltaRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The avatar delta rotation")] + [RequiredField] + public SharedQuaternion storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.deltaRotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + if (storeValue != null) { + storeValue.Value = Quaternion.identity; + } + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs.meta new file mode 100644 index 00000000..a26ba42a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetDeltaRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f120073dca714344495aa139eea16e2b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs new file mode 100644 index 00000000..63182145 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the float parameter on an animator. Returns Success.")] + public class GetFloatParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the float parameter")] + [RequiredField] + public SharedFloat storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.GetFloat(paramaterName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs.meta new file mode 100644 index 00000000..3dcbccc5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetFloatParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d33dbb5444b5bbe44bb200e39823cfe1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs new file mode 100644 index 00000000..a9cd172a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the current gravity weight based on current animations that are played. Returns Success.")] + public class GetGravityWeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The value of the gravity weight")] + [RequiredField] + public SharedFloat storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.gravityWeight; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs.meta new file mode 100644 index 00000000..21b687ce --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetGravityWeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 945593329da80b44898e7e1ae1883d07 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs new file mode 100644 index 00000000..920d5bc4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the integer parameter on an animator. Returns Success.")] + public class GetIntegerParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the integer parameter")] + [RequiredField] + public SharedInt storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.GetInteger(paramaterName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs.meta new file mode 100644 index 00000000..6834594b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetIntegerParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8640eaeae64c2e48ba85336474d59d8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs new file mode 100644 index 00000000..0d3a8e69 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the layer's weight. Returns Success.")] + public class GetLayerWeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The index of the layer")] + public SharedInt index; + [Tooltip("The value of the float parameter")] + [RequiredField] + public SharedFloat storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.GetLayerWeight(index.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + index = 0; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs.meta new file mode 100644 index 00000000..4c0e6cab --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetLayerWeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 346c4295a827d9e4c8029cd29a8e18ca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs new file mode 100644 index 00000000..5adc55e6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stores the playback speed of the animator. 1 is normal playback speed. Returns Success.")] + public class GetSpeed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The playback speed of the Animator")] + [RequiredField] + public SharedFloat storeValue; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + //Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + storeValue.Value = animator.speed; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs.meta new file mode 100644 index 00000000..c4d6ee6b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetSpeed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f87648f776ab12c45883b01e9bebc6a3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs new file mode 100644 index 00000000..a7a9843b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Converts the state name to its corresponding hash code. Returns Success.")] + public class GetStringToHash : Action + { + [Tooltip("The name of the state to convert to a hash code")] + public SharedString stateName; + [Tooltip("The hash value")] + [RequiredField] + public SharedInt storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = Animator.StringToHash(stateName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + stateName = ""; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs.meta new file mode 100644 index 00000000..f0f50384 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/GetStringToHash.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 234dcf26bcb550043b3b5de33f0e6a11 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs new file mode 100644 index 00000000..d958848e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Interrupts the automatic target matching. Returns Success.")] + public class InterruptMatchTarget : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("CompleteMatch will make the gameobject match the target completely at the next frame")] + public bool completeMatch = true; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.InterruptMatchTarget(completeMatch); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + completeMatch = true; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs.meta new file mode 100644 index 00000000..0753ae2d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/InterruptMatchTarget.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 766d802f8842a2945b11253f60d431bb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs new file mode 100644 index 00000000..e9366eaa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Returns success if the specified AnimatorController layer in a transition.")] + public class IsInTransition : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The layer's index")] + public SharedInt index; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + return animator.IsInTransition(index.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + index = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs.meta new file mode 100644 index 00000000..39c1452c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsInTransition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 48c086aaf693a604d8b83eabac3b568e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs new file mode 100644 index 00000000..38869983 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Returns success if the specified name matches the name of the active state.")] + public class IsName : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The layer's index")] + public SharedInt index; + [Tooltip("The state name to compare")] + public SharedString name; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + return animator.GetCurrentAnimatorStateInfo(index.Value).IsName(name.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + index = 0; + name = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs.meta new file mode 100644 index 00000000..7f8263ae --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsName.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 96051e2f6a0e7ea42a493e6245e4ccde +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs new file mode 100644 index 00000000..84664930 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Returns success if the specified parameter is controlled by an additional curve on an animation.")] + public class IsParameterControlledByCurve : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + return animator.IsParameterControlledByCurve(paramaterName.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs.meta new file mode 100644 index 00000000..80412d1a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/IsParameterControlledByCurve.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5eb4141402ab7c4abb1d4a5c687a757 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs new file mode 100644 index 00000000..c0137247 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs @@ -0,0 +1,62 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Automatically adjust the gameobject position and rotation so that the AvatarTarget reaches the matchPosition when the current state is at the specified progress. Returns Success.")] + public class MatchTarget : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position we want the body part to reach")] + public SharedVector3 matchPosition; + [Tooltip("The rotation in which we want the body part to be")] + public SharedQuaternion matchRotation; + [Tooltip("The body part that is involved in the match")] + public AvatarTarget targetBodyPart; + [Tooltip("Weights for matching position")] + public Vector3 weightMaskPosition; + [Tooltip("Weights for matching rotation")] + public float weightMaskRotation; + [Tooltip("Start time within the animation clip")] + public float startNormalizedTime; + [Tooltip("End time within the animation clip")] + public float targetNormalizedTime = 1; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.MatchTarget(matchPosition.Value, matchRotation.Value, targetBodyPart, new MatchTargetWeightMask(weightMaskPosition, weightMaskRotation), startNormalizedTime, targetNormalizedTime); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + matchPosition = Vector3.zero; + matchRotation = Quaternion.identity; + targetBodyPart = AvatarTarget.Root; + weightMaskPosition = Vector3.zero; + weightMaskRotation = 0; + startNormalizedTime = 0; + targetNormalizedTime = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs.meta new file mode 100644 index 00000000..d4cfe707 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/MatchTarget.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0e788b711539ed4dad258780be29de6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs new file mode 100644 index 00000000..e76934df --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs @@ -0,0 +1,50 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Plays an animator state. Returns Success.")] + public class Play : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the state")] + public SharedString stateName; + [Tooltip("The layer where the state is")] + public int layer = -1; + [Tooltip("The normalized time at which the state will play")] + public float normalizedTime = float.NegativeInfinity; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.Play(stateName.Value, layer, normalizedTime); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + stateName = ""; + layer = -1; + normalizedTime = float.NegativeInfinity; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs.meta new file mode 100644 index 00000000..5d05a683 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/Play.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a62df911d37cd8349b0168f875cd58ea +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs new file mode 100644 index 00000000..c6c81be8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets if root motion is applied. Returns Success.")] + public class SetApplyRootMotion : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Is root motion applied?")] + public SharedBool rootMotion; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.applyRootMotion = rootMotion.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rootMotion = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs.meta new file mode 100644 index 00000000..dac11abd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetApplyRootMotion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f10479b97efcbb94a8089a12bf891b5b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs new file mode 100644 index 00000000..2f8a93c5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs @@ -0,0 +1,62 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the bool parameter on an animator. Returns Success.")] + public class SetBoolParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the bool parameter")] + public SharedBool boolValue; + [Tooltip("Should the value be reverted back to its original value after it has been set?")] + public bool setOnce; + + private int hashID; + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + hashID = UnityEngine.Animator.StringToHash(paramaterName.Value); + + bool prevValue = animator.GetBool(hashID); + animator.SetBool(hashID, boolValue.Value); + if (setOnce) { + StartCoroutine(ResetValue(prevValue)); + } + return TaskStatus.Success; + } + + public IEnumerator ResetValue(bool origVale) + { + yield return null; + animator.SetBool(hashID, origVale); + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + boolValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs.meta new file mode 100644 index 00000000..7bd49fa8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetBoolParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04e0905e87bf90a408551067942c08c7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs new file mode 100644 index 00000000..77093432 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs @@ -0,0 +1,63 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the float parameter on an animator. Returns Success.")] + public class SetFloatParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the float parameter")] + public SharedFloat floatValue; + [Tooltip("Should the value be reverted back to its original value after it has been set?")] + public bool setOnce; + + private int hashID; + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + hashID = UnityEngine.Animator.StringToHash(paramaterName.Value); + + float prevValue = animator.GetFloat(hashID); + animator.SetFloat(hashID, floatValue.Value); + if (setOnce) { + StartCoroutine(ResetValue(prevValue)); + } + + return TaskStatus.Success; + } + + public IEnumerator ResetValue(float origVale) + { + yield return null; + animator.SetFloat(hashID, origVale); + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + floatValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs.meta new file mode 100644 index 00000000..9e216986 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetFloatParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b601abdc989d2ce4f8dc0d3434705814 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs new file mode 100644 index 00000000..39fdcca7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs @@ -0,0 +1,63 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the int parameter on an animator. Returns Success.")] + public class SetIntegerParameter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + [Tooltip("The value of the int parameter")] + public SharedInt intValue; + [Tooltip("Should the value be reverted back to its original value after it has been set?")] + public bool setOnce; + + private int hashID; + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + hashID = UnityEngine.Animator.StringToHash(paramaterName.Value); + + int prevValue = animator.GetInteger(hashID); + animator.SetInteger(hashID, intValue.Value); + if (setOnce) { + StartCoroutine(ResetValue(prevValue)); + } + + return TaskStatus.Success; + } + + public IEnumerator ResetValue(int origVale) + { + yield return null; + animator.SetInteger(hashID, origVale); + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName = ""; + intValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs.meta new file mode 100644 index 00000000..ded6b0ed --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetIntegerParameter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 07345b9144172a74892b176413bf9ac3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs new file mode 100644 index 00000000..ae5b529f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the layer's current weight. Returns Success.")] + public class SetLayerWeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The layer's index")] + public SharedInt index; + [Tooltip("The weight of the layer")] + public SharedFloat weight; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.SetLayerWeight(index.Value, weight.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + index = 0; + weight = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs.meta new file mode 100644 index 00000000..6ee4ea45 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLayerWeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 979ffd79261d4bb499331ba9fa80ed7d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs new file mode 100644 index 00000000..2f3ece3e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the look at position. Returns Success.")] + public class SetLookAtPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position to lookAt")] + public SharedVector3 position; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.SetLookAtPosition(position.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs.meta new file mode 100644 index 00000000..9cca866d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31c4894aafa2b7f40984915713cff50b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs new file mode 100644 index 00000000..e8881e5c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs @@ -0,0 +1,57 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the look at weight. Returns success immediately after.")] + public class SetLookAtWeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("(0-1) the global weight of the LookAt, multiplier for other parameters.")] + public SharedFloat weight; + [Tooltip("(0-1) determines how much the body is involved in the LookAt.")] + public float bodyWeight; + [Tooltip("(0-1) determines how much the head is involved in the LookAt.")] + public float headWeight = 1; + [Tooltip("(0-1) determines how much the eyes are involved in the LookAt.")] + public float eyesWeight; + [Tooltip("(0-1) 0.0 means the character is completely unrestrained in motion, 1.0 means he's completely clamped " + + "(look at becomes impossible), and 0.5 means he'll be able to move on half of the possible range (180 degrees).")] + public float clampWeight = 0.5f; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.SetLookAtWeight(weight.Value, bodyWeight, headWeight, eyesWeight, clampWeight); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + weight = 0; + bodyWeight = 0; + headWeight = 1; + eyesWeight = 0; + clampWeight = 0.5f; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs.meta new file mode 100644 index 00000000..f69692c9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetLookAtWeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d700204dde35cd4c9e5a8553089127e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs new file mode 100644 index 00000000..e38f45ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the playback speed of the Animator. 1 is normal playback speed. Returns Success.")] + public class SetSpeed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The playback speed of the Animator")] + public SharedFloat speed; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.speed = speed.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + speed = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs.meta new file mode 100644 index 00000000..f30c47bd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetSpeed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5cd3c9afb48ee541afcce2dade6bc6a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs new file mode 100644 index 00000000..085fe89b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets a trigger parameter to active or inactive. Returns Success.")] + public class SetTrigger : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the parameter")] + public SharedString paramaterName; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.SetTrigger(paramaterName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + paramaterName.Value = ""; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs.meta new file mode 100644 index 00000000..fc5f8f1e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/SetTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 004807d2b68cad7459f6d84ce1274c16 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs new file mode 100644 index 00000000..6c35b0e9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the animator in playback mode.")] + public class StartPlayback : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.StartPlayback(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs.meta new file mode 100644 index 00000000..7332f68e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartPlayback.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46d4b19160ba8774ea6100dda4288753 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs new file mode 100644 index 00000000..f9ebf502 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Sets the animator in recording mode. Returns Success.")] + public class StartRecording : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The number of frames (updates) that will be recorded")] + public int frameCount; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.StartRecording(frameCount); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + frameCount = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs.meta new file mode 100644 index 00000000..87f0ddb2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StartRecording.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d6f14b502ed889444a0e44e8cb06e767 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs new file mode 100644 index 00000000..8096b930 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stops the animator playback mode. Returns Success.")] + public class StopPlayback : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.StopPlayback(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs.meta new file mode 100644 index 00000000..eb10c87f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopPlayback.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7daa3c083e51ad44a8c8b05bb4e70689 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs new file mode 100644 index 00000000..cd531c7f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAnimator +{ + [TaskCategory("Basic/Animator")] + [TaskDescription("Stops animator record mode. Returns Success.")] + public class StopRecording : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Animator animator; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + animator = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (animator == null) { + Debug.LogWarning("Animator is null"); + return TaskStatus.Failure; + } + + animator.StopRecording(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs.meta new file mode 100644 index 00000000..d8001590 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Animator/StopRecording.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c62c2817a5d72054caebff852d50ef17 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource.meta new file mode 100644 index 00000000..6d125e5a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 8d2af13ebd5ef0b428b7ea2a3eb85c95 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs new file mode 100644 index 00000000..e0906252 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the ignore listener pause value of the AudioSource. Returns Success.")] + public class GetIgnoreListenerPause : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The ignore listener pause value of the AudioSource")] + [RequiredField] + public SharedBool storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.ignoreListenerPause; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs.meta new file mode 100644 index 00000000..aca007cf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerPause.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3bd7bb287fe91747bca60ebe3d53e87 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs new file mode 100644 index 00000000..12885ddf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the ignore listener volume value of the AudioSource. Returns Success.")] + public class GetIgnoreListenerVolume : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The ignore listener volume value of the AudioSource")] + [RequiredField] + public SharedBool storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.ignoreListenerVolume; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs.meta new file mode 100644 index 00000000..5176b8f8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetIgnoreListenerVolume.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c45986918364dfc4e9eca01d2839e2e4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs new file mode 100644 index 00000000..c1cd0a7d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the loop value of the AudioSource. Returns Success.")] + public class GetLoop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The loop value of the AudioSource")] + [RequiredField] + public SharedBool storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.loop; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs.meta new file mode 100644 index 00000000..a5d37f95 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetLoop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 699b9d0d798a219459c6477d2c21d4ba +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs new file mode 100644 index 00000000..cf8b9ed3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the max distance value of the AudioSource. Returns Success.")] + public class GetMaxDistance : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The max distance value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.maxDistance; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs.meta new file mode 100644 index 00000000..2cb3e832 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMaxDistance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e2b2500d8e2b0c45825c0650f64eae2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs new file mode 100644 index 00000000..6fe9aed3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the min distance value of the AudioSource. Returns Success.")] + public class GetMinDistance : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The min distance value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.minDistance; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs.meta new file mode 100644 index 00000000..20401fd0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMinDistance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cad762e82ef22644ca968b4a1c51eaec +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs new file mode 100644 index 00000000..f2cee2f2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the mute value of the AudioSource. Returns Success.")] + public class GetMute : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mute value of the AudioSource")] + [RequiredField] + public SharedBool storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.mute; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs.meta new file mode 100644 index 00000000..71acfb23 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetMute.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 51df88b2df77e294cb673105b1c36961 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs new file mode 100644 index 00000000..7b3776f0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the pan value of the AudioSource. Returns Success.")] + public class GetPan : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pan value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.pan; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs.meta new file mode 100644 index 00000000..412a9887 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPan.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 181cebd8ca2b5da47a89cd738e36e4dd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs new file mode 100644 index 00000000..0084d836 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the pan level value of the AudioSource. Returns Success.")] + public class GetPanLevel : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pan level value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.panLevel; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs.meta new file mode 100644 index 00000000..3a177668 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPanLevel.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f00191099bcac3c4fad2922fbc8ede2b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs new file mode 100644 index 00000000..21ddf55d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the pitch value of the AudioSource. Returns Success.")] + public class GetPitch : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pitch value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.pitch; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs.meta new file mode 100644 index 00000000..c23193a0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPitch.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 930fa7881ae9236449d90546f9922656 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs new file mode 100644 index 00000000..bb519ef0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the priority value of the AudioSource. Returns Success.")] + public class GetPriority : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The priority value of the AudioSource")] + [RequiredField] + public SharedInt storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.priority; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs.meta new file mode 100644 index 00000000..4bf1ba3e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetPriority.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de856d580ad945e4d846fa52d3d647cc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs new file mode 100644 index 00000000..a4b28d99 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the spread value of the AudioSource. Returns Success.")] + public class GetSpread : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The spread value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.spread; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs.meta new file mode 100644 index 00000000..8616ca5f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetSpread.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba6a60eccf688514392e782348b84628 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs new file mode 100644 index 00000000..1838133a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the time value of the AudioSource. Returns Success.")] + public class GetTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The time value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.time; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs.meta new file mode 100644 index 00000000..3d1c547f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 600c95fc760afa140bd0a7b98bd5071f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs new file mode 100644 index 00000000..367f4b3f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the time samples value of the AudioSource. Returns Success.")] + public class GetTimeSamples : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The time samples value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.timeSamples; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs.meta new file mode 100644 index 00000000..40d3ea23 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetTimeSamples.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af34adc5779f33442909ff32140dcdd4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs new file mode 100644 index 00000000..4610f4ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stores the volume value of the AudioSource. Returns Success.")] + public class GetVolume : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The volume value of the AudioSource")] + [RequiredField] + public SharedFloat storeValue; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + storeValue.Value = audioSource.volume; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs.meta new file mode 100644 index 00000000..fdb362b6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/GetVolume.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aad3b2c644baeb646b0b33b7317413d4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs new file mode 100644 index 00000000..7b457902 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Returns Success if the AudioClip is playing, otherwise Failure.")] + public class IsPlaying : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + return audioSource.isPlaying ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs.meta new file mode 100644 index 00000000..e830c656 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/IsPlaying.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20fb79d98326b794fb309a291613cab4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs new file mode 100644 index 00000000..1d5347ad --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Pauses the audio clip. Returns Success.")] + public class Pause : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.Pause(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs.meta new file mode 100644 index 00000000..140e52a3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Pause.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91db8dd58e79db745acc39f3f52da88e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs new file mode 100644 index 00000000..3e711027 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Plays the audio clip. Returns Success.")] + public class Play : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.Play(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs.meta new file mode 100644 index 00000000..52452b5a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Play.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ac8cfb80c6a44c42b4ac4eef6f29bd5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs new file mode 100644 index 00000000..7618bd7c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Plays the audio clip with a delay specified in seconds. Returns Success.")] + public class PlayDelayed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Delay time specified in seconds")] + public SharedFloat delay = 0; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.PlayDelayed(delay.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + delay = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs.meta new file mode 100644 index 00000000..fb881a38 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayDelayed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0125706a59bb7974eb3d425d3869779a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs new file mode 100644 index 00000000..1d04f8e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Plays an AudioClip, and scales the AudioSource volume by volumeScale. Returns Success.")] + public class PlayOneShot : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The clip being played")] + public SharedObject clip; + [Tooltip("The scale of the volume (0-1)")] + public SharedFloat volumeScale = 1; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.PlayOneShot((AudioClip)clip.Value, volumeScale.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + clip = null; + volumeScale = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs.meta new file mode 100644 index 00000000..4bc09ae8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayOneShot.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 112c969d16008464f96ce23aa5b32486 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs new file mode 100644 index 00000000..d854790d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Plays the audio clip with a delay specified in seconds. Returns Success.")] + public class PlayScheduled : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time in seconds on the absolute time-line that AudioSettings.dspTime refers to for when the sound should start playing")] + public SharedFloat time = 0; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.PlayScheduled(time.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs.meta new file mode 100644 index 00000000..8c3e45f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/PlayScheduled.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 08d431471ffd8954197b88b698f0d424 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs new file mode 100644 index 00000000..71941195 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the clip value of the AudioSource. Returns Success.")] + public class SetAudioClip : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The AudioSource clip")] + public AudioClip audioClip; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.clip = audioClip; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + audioClip = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs.meta new file mode 100644 index 00000000..df8eac5c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetAudioClip.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f52d9d404f7deab448e4f5c2bb3f7892 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs new file mode 100644 index 00000000..1b0f14b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the ignore listener volume value of the AudioSource. Returns Success.")] + public class SetIgnoreListenerVolume : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The ignore listener volume value of the AudioSource")] + public SharedBool ignoreListenerVolume; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.ignoreListenerVolume = ignoreListenerVolume.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + ignoreListenerVolume = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs.meta new file mode 100644 index 00000000..e6c2790c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerPause.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d617db8232463c444a8a3159da109798 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs new file mode 100644 index 00000000..787637b2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the ignore listener pause value of the AudioSource. Returns Success.")] + public class SetIgnoreListenerPause : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The ignore listener pause value of the AudioSource")] + public SharedBool ignoreListenerPause; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.ignoreListenerPause = ignoreListenerPause.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + ignoreListenerPause = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs.meta new file mode 100644 index 00000000..6b86a289 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetIgnoreListenerVolume.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f1f5937bfa03484296c0fb5a9ce9b29 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs new file mode 100644 index 00000000..38a47ba3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the loop value of the AudioSource. Returns Success.")] + public class SetLoop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The loop value of the AudioSource")] + public SharedBool loop; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.loop = loop.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + loop = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs.meta new file mode 100644 index 00000000..d8e3cc04 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetLoop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50536bd6b5fa6924bb7217dd3b6e3f45 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs new file mode 100644 index 00000000..17487708 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the max distance value of the AudioSource. Returns Success.")] + public class SetMaxDistance : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The max distance value of the AudioSource")] + public SharedFloat maxDistance; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.maxDistance = maxDistance.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + maxDistance = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs.meta new file mode 100644 index 00000000..2d67b172 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMaxDistance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0c75cf2afc289c4a8962f71b5e17dd1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs new file mode 100644 index 00000000..f693e4a8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the min distance value of the AudioSource. Returns Success.")] + public class SetMinDistance : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The min distance value of the AudioSource")] + public SharedFloat minDistance; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.minDistance = minDistance.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + minDistance = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs.meta new file mode 100644 index 00000000..6e87631a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMinDistance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccb3beba9296fc54d8427cd646af4f4e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs new file mode 100644 index 00000000..0d45e2df --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the mute value of the AudioSource. Returns Success.")] + public class SetMute : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mute value of the AudioSource")] + public SharedBool mute; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.mute = mute.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + mute = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs.meta new file mode 100644 index 00000000..7296e828 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetMute.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec553c7ad9360a24fb7ce3bf3bc48c97 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs new file mode 100644 index 00000000..bd6d1853 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the pan value of the AudioSource. Returns Success.")] + public class SetPan : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pan value of the AudioSource")] + public SharedFloat pan; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.pan = pan.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + pan = 1; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs.meta new file mode 100644 index 00000000..5ee56ec2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPan.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed66670f171cea24c9208fff10bfc43d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs new file mode 100644 index 00000000..b1f24307 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the pan level value of the AudioSource. Returns Success.")] + public class SetPanLevel : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pan level value of the AudioSource")] + public SharedFloat panLevel; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.panLevel = panLevel.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + panLevel = 1; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs.meta new file mode 100644 index 00000000..ca4e90f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPanLevel.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 219609a4a0818d746a7828dc968c31a9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs new file mode 100644 index 00000000..9a6de27f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the pitch value of the AudioSource. Returns Success.")] + public class SetPitch : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The pitch value of the AudioSource")] + public SharedFloat pitch; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.pitch = pitch.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + pitch = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs.meta new file mode 100644 index 00000000..71a8ff21 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPitch.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c7615ddc4e92fd41b72de06f039f9e1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs new file mode 100644 index 00000000..1a1532ea --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the priority value of the AudioSource. Returns Success.")] + public class SetPriority : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The priority value of the AudioSource")] + public SharedInt priority; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.priority = priority.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + priority = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs.meta new file mode 100644 index 00000000..0a8e4128 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetPriority.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fc15622e17101f4b95be39910433c8a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs new file mode 100644 index 00000000..0b142108 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the rolloff mode of the AudioSource. Returns Success.")] + public class SetRolloffMode : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rolloff mode of the AudioSource")] + public AudioRolloffMode rolloffMode; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.rolloffMode = rolloffMode; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rolloffMode = AudioRolloffMode.Logarithmic; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs.meta new file mode 100644 index 00000000..0d7fe458 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetRolloffMode.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef88d71b5b7e0a84d98bde6405eb294d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs new file mode 100644 index 00000000..b214f713 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Changes the time at which a sound that has already been scheduled to play will end. Notice that depending on the " + + "timing not all rescheduling requests can be fulfilled. Returns Success.")] + public class SetScheduledEndTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time in seconds")] + public SharedFloat time = 0; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.SetScheduledEndTime(time.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs.meta new file mode 100644 index 00000000..3f0af6c4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledEndTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8867d64aa9a2add4f913b8b5faa9d1ce +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs new file mode 100644 index 00000000..4c5b890c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Changes the time at which a sound that has already been scheduled to play will start. Returns Success.")] + public class SetScheduledStartTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time in seconds")] + public SharedFloat time = 0; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.SetScheduledStartTime(time.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs.meta new file mode 100644 index 00000000..4dbd7c6a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetScheduledStartTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf64b74120564064a8d9c622ccc7115a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs new file mode 100644 index 00000000..f4657fcd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the spread value of the AudioSource. Returns Success.")] + public class SetSpread : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The spread value of the AudioSource")] + public SharedFloat spread; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.spread = spread.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + spread = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs.meta new file mode 100644 index 00000000..89329407 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetSpread.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f6d964d5fdf24bf449d3f59de1864dd8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs new file mode 100644 index 00000000..637789e8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the time value of the AudioSource. Returns Success.")] + public class SetTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The time value of the AudioSource")] + public SharedFloat time; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.time = time.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs.meta new file mode 100644 index 00000000..bc128b7a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3173ce3fda9d60f48b159759f8981f89 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs new file mode 100644 index 00000000..53dddaa0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the rolloff mode of the AudioSource. Returns Success.")] + public class SetVelocityUpdateMode : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity update mode of the AudioSource")] + public AudioVelocityUpdateMode velocityUpdateMode; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.velocityUpdateMode = velocityUpdateMode; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + velocityUpdateMode = AudioVelocityUpdateMode.Auto; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs.meta new file mode 100644 index 00000000..606e6903 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVelocityUpdateMode.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c26ea6b22d3fa7843a73e5088376996c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs new file mode 100644 index 00000000..80ee7189 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Sets the volume value of the AudioSource. Returns Success.")] + public class SetVolume : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The volume value of the AudioSource")] + public SharedFloat volume; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.volume = volume.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + volume = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs.meta new file mode 100644 index 00000000..16176d79 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/SetVolume.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edfc39045c7af164fb340d21762e4d79 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs new file mode 100644 index 00000000..f351635c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource +{ + [TaskCategory("Basic/AudioSource")] + [TaskDescription("Stops playing the audio clip. Returns Success.")] + public class Stop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private AudioSource audioSource; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + audioSource = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (audioSource == null) { + Debug.LogWarning("AudioSource is null"); + return TaskStatus.Failure; + } + + audioSource.Stop(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs.meta new file mode 100644 index 00000000..66ee21a5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd4cec1e9e81e664d8e7782bd02bcade +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour.meta new file mode 100644 index 00000000..0b619c46 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 51de5dc2234f2d642b8b53dd9ccc9be3 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs new file mode 100644 index 00000000..c34c4133 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBehaviour +{ + [TaskCategory("Basic/Behaviour")] + [TaskDescription("Stores the enabled state of the object. Returns Success.")] + public class GetIsEnabled : Action + { + [Tooltip("The Object to use")] + public SharedObject specifiedObject; + [Tooltip("The enabled/disabled state")] + [RequiredField] + public SharedBool storeValue; + + public override TaskStatus OnUpdate() + { + if (specifiedObject == null && !(specifiedObject.Value is UnityEngine.Behaviour)) { + Debug.LogWarning("SpecifiedObject is null or not a subclass of UnityEngine.Behaviour"); + return TaskStatus.Failure; + } + + storeValue.Value = (specifiedObject.Value as Behaviour).enabled; + + return TaskStatus.Success; + } + + public override void OnReset() + { + if (specifiedObject != null) { + specifiedObject.Value = null; + } + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs.meta new file mode 100644 index 00000000..55e67554 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/GetIsEnabled.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad6519dede06d7b46b95e54bb60be281 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs new file mode 100644 index 00000000..78fb031f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBehaviour +{ + [TaskCategory("Basic/Behaviour")] + [TaskDescription("Returns Success if the object is enabled, otherwise Failure.")] + public class IsEnabled : Conditional + { + [Tooltip("The Object to use")] + public SharedObject specifiedObject; + + public override TaskStatus OnUpdate() + { + if (specifiedObject == null && !(specifiedObject.Value is UnityEngine.Behaviour)) { + Debug.LogWarning("SpecifiedObject is null or not a subclass of UnityEngine.Behaviour"); + return TaskStatus.Failure; + } + + return (specifiedObject.Value as Behaviour).enabled ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + if (specifiedObject != null) { + specifiedObject.Value = null; + } + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs.meta new file mode 100644 index 00000000..f66d6058 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/IsEnabled.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32f61cbdb8bdf1e44bf418ca21681bc3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs new file mode 100644 index 00000000..535355fd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBehaviour +{ + [TaskCategory("Basic/Behaviour")] + [TaskDescription("Enables/Disables the object. Returns Success.")] + public class SetIsEnabled : Action + { + [Tooltip("The Object to use")] + public SharedObject specifiedObject; + [Tooltip("The enabled/disabled state")] + public SharedBool enabled; + + public override TaskStatus OnUpdate() + { + if (specifiedObject == null && !(specifiedObject.Value is UnityEngine.Behaviour)) { + Debug.LogWarning("SpecifiedObject is null or not a subclass of UnityEngine.Behaviour"); + return TaskStatus.Failure; + } + + (specifiedObject.Value as Behaviour).enabled = enabled.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + if (specifiedObject != null) { + specifiedObject.Value = null; + } + enabled = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs.meta new file mode 100644 index 00000000..623d440c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Behaviour/SetIsEnabled.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf7703ff7e9055e4f811a5b95bf18930 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider.meta new file mode 100644 index 00000000..885853b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 876af1fbcf3642e4b987507ed975a15a +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs new file mode 100644 index 00000000..83bf9367 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider +{ + [TaskCategory("Basic/BoxCollider")] + [TaskDescription("Stores the center of the BoxCollider. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the BoxCollider")] + [RequiredField] + public SharedVector3 storeValue; + + private BoxCollider boxCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider == null) { + Debug.LogWarning("BoxCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = boxCollider.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta new file mode 100644 index 00000000..61b2c34f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c3ae13d2bd0e5f4186835c672d9461f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs new file mode 100644 index 00000000..d358a83b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider +{ + [TaskCategory("Basic/BoxCollider")] + [TaskDescription("Stores the size of the BoxCollider. Returns Success.")] + public class GetSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The size of the BoxCollider")] + [RequiredField] + public SharedVector3 storeValue; + + private BoxCollider boxCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider == null) { + Debug.LogWarning("BoxCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = boxCollider.size; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta new file mode 100644 index 00000000..934ee86c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/GetSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0afec21454700d3479c4f9767f9382f9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs new file mode 100644 index 00000000..e24eec2a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider +{ + [TaskCategory("Basic/BoxCollider")] + [TaskDescription("Sets the center of the BoxCollider. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the BoxCollider")] + public SharedVector3 center; + + private BoxCollider boxCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider == null) { + Debug.LogWarning("BoxCollider is null"); + return TaskStatus.Failure; + } + + boxCollider.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta new file mode 100644 index 00000000..9787d48f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45b3b4dc79247bd46a9c2b11fa9b125c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs new file mode 100644 index 00000000..1ee03fa2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider +{ + [TaskCategory("Basic/BoxCollider")] + [TaskDescription("Sets the size of the BoxCollider. Returns Success.")] + public class SetSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The size of the BoxCollider")] + public SharedVector3 size; + + private BoxCollider boxCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider == null) { + Debug.LogWarning("BoxCollider is null"); + return TaskStatus.Failure; + } + + boxCollider.size = size.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + size = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta new file mode 100644 index 00000000..e00c7d4a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider/SetSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d899b6ed83f6e264f8e5867cf68c0cda +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D.meta new file mode 100644 index 00000000..6da12847 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: c7814e7f18119144182f77f9b2a01af2 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs new file mode 100644 index 00000000..60c05b77 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D +{ + [TaskCategory("Basic/BoxCollider2D")] + [TaskDescription("Stores the center of the BoxCollider2D. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the BoxCollider2D")] + [RequiredField] + public SharedVector2 storeValue; + + private BoxCollider2D boxCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider2D == null) { + Debug.LogWarning("BoxCollider2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = boxCollider2D.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector2.zero; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta new file mode 100644 index 00000000..87ce1000 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97045dc4cff50664994b74ec1d41dfb9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs new file mode 100644 index 00000000..e539eb30 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D +{ + [TaskCategory("Basic/BoxCollider2D")] + [TaskDescription("Stores the size of the BoxCollider2D. Returns Success.")] + public class GetSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The size of the BoxCollider2D")] + [RequiredField] + public SharedVector2 storeValue; + + private BoxCollider2D boxCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider2D == null) { + Debug.LogWarning("BoxCollider2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = boxCollider2D.size; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta new file mode 100644 index 00000000..362df45f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/GetSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c69113b787759f340aacbb9d99a6d654 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs new file mode 100644 index 00000000..f6c74d1c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D +{ + [TaskCategory("Basic/BoxCollider2D")] + [TaskDescription("Sets the center of the BoxCollider2D. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the BoxCollider2D")] + public SharedVector2 center; + + private BoxCollider2D boxCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider2D == null) { + Debug.LogWarning("BoxCollider2D is null"); + return TaskStatus.Failure; + } + + boxCollider2D.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector2.zero; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta new file mode 100644 index 00000000..70e26e5b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: beddee09fde7fe24b894ef43edc1998a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs new file mode 100644 index 00000000..5de4a500 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityBoxCollider2D +{ + [TaskCategory("Basic/BoxCollider2D")] + [TaskDescription("Sets the size of the BoxCollider2D. Returns Success.")] + public class SetSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The size of the BoxCollider2D")] + public SharedVector2 size; + + private BoxCollider2D boxCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + boxCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (boxCollider2D == null) { + Debug.LogWarning("BoxCollider2D is null"); + return TaskStatus.Failure; + } + + boxCollider2D.size = size.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + size = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta new file mode 100644 index 00000000..f5af4e82 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/BoxCollider2D/SetSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1875fd00045d98848b028015a17aeeaf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider.meta new file mode 100644 index 00000000..7102a3e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 0cf43865b0892fb48ac285f63910ff97 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs new file mode 100644 index 00000000..05e4c8e4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Stores the center of the CapsuleCollider. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CapsuleCollider")] + [RequiredField] + public SharedVector3 storeValue; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = capsuleCollider.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta new file mode 100644 index 00000000..3256d554 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a032cb4c0b97b844ad53ad7bb2617c3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs new file mode 100644 index 00000000..56f394b9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Stores the direction of the CapsuleCollider. Returns Success.")] + public class GetDirection : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The direction of the CapsuleCollider")] + [RequiredField] + public SharedInt storeValue; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = capsuleCollider.direction; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta new file mode 100644 index 00000000..3e32e995 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetDirection.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e9f2ebb599281345a458fab17aab5fd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs new file mode 100644 index 00000000..98c38d5e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Gets the height of the CapsuleCollider. Returns Success.")] + public class GetHeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The height of the CapsuleCollider")] + [RequiredField] + public SharedFloat storeValue; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = capsuleCollider.height; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta new file mode 100644 index 00000000..8f56770b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetHeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 29e860749600e174aa61dd42be0a3126 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs new file mode 100644 index 00000000..b1df3bc9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Stores the radius of the CapsuleCollider. Returns Success.")] + public class GetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CapsuleCollider")] + [RequiredField] + public SharedFloat storeValue; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = capsuleCollider.radius; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta new file mode 100644 index 00000000..006177a6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/GetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d03b50a6f076c75408ef6e843bd75539 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs new file mode 100644 index 00000000..c72abb9b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Sets the center of the CapsuleCollider. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CapsuleCollider")] + public SharedVector3 center; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + capsuleCollider.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta new file mode 100644 index 00000000..8b888bdd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8292285661aa7e4086c0b59926632c3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs new file mode 100644 index 00000000..e07ee642 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Sets the direction of the CapsuleCollider. Returns Success.")] + public class SetDirection : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The direction of the CapsuleCollider")] + public SharedInt direction; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + capsuleCollider.direction = direction.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + direction = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta new file mode 100644 index 00000000..15fea291 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetDirection.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4146b45b3a598294f86dbbac03e6e8cb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs new file mode 100644 index 00000000..2f734d5d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Sets the height of the CapsuleCollider. Returns Success.")] + public class SetHeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The height of the CapsuleCollider")] + public SharedFloat direction; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + capsuleCollider.height = direction.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + direction = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta new file mode 100644 index 00000000..60d24f8f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetHeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34f947c079c1159488c80854ee53ecd8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs new file mode 100644 index 00000000..963dfe47 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCapsuleCollider +{ + [TaskCategory("Basic/CapsuleCollider")] + [TaskDescription("Sets the radius of the CapsuleCollider. Returns Success.")] + public class SetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CapsuleCollider")] + public SharedFloat radius; + + private CapsuleCollider capsuleCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + capsuleCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (capsuleCollider == null) { + Debug.LogWarning("CapsuleCollider is null"); + return TaskStatus.Failure; + } + + capsuleCollider.radius = radius.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + radius = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta new file mode 100644 index 00000000..ae2e46ca --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CapsuleCollider/SetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fed5a0f5604af324cb2e4a3ed9315793 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController.meta new file mode 100644 index 00000000..541a260d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 4b58bcba0c40cfc448a1f2a5f2a57c57 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs new file mode 100644 index 00000000..a05eb82a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the center of the CharacterController. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CharacterController")] + [RequiredField] + public SharedVector3 storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + storeValue.Value = characterController.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs.meta new file mode 100644 index 00000000..d0c9a496 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e4033e3d9c7ef994ba600b3afec28a0d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs new file mode 100644 index 00000000..1317129e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the height of the CharacterController. Returns Success.")] + public class GetHeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The height of the CharacterController")] + [RequiredField] + public SharedFloat storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + storeValue.Value = characterController.height; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs.meta new file mode 100644 index 00000000..d1dd43b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetHeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eec31e6d5685c674fa2952757b4adf9a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs new file mode 100644 index 00000000..67c3d1ff --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the radius of the CharacterController. Returns Success.")] + public class GetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CharacterController")] + [RequiredField] + public SharedFloat storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + storeValue.Value = characterController.radius; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs.meta new file mode 100644 index 00000000..81e97192 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3bf330244cdea3b43ad95e8731fdb78b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs new file mode 100644 index 00000000..cb33ff2a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the slope limit of the CharacterController. Returns Success.")] + public class GetSlopeLimit : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The slope limit of the CharacterController")] + [RequiredField] + public SharedFloat storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + storeValue.Value = characterController.slopeLimit; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs.meta new file mode 100644 index 00000000..c6bf9789 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetSlopeLimit.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3cb445c34dce1a14aa5134278025ec59 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs new file mode 100644 index 00000000..f4d14456 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the step offset of the CharacterController. Returns Success.")] + public class GetStepOffset : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The step offset of the CharacterController")] + [RequiredField] + public SharedFloat storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + storeValue.Value = characterController.stepOffset; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs.meta new file mode 100644 index 00000000..17385174 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetStepOffset.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9bb8d4be247f4d4cb9b2b05a6efd48f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs new file mode 100644 index 00000000..2c4ee10a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Stores the velocity of the CharacterController. Returns Success.")] + public class GetVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity of the CharacterController")] + [RequiredField] + public SharedVector3 storeValue; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + storeValue.Value = characterController.velocity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs.meta new file mode 100644 index 00000000..23ec32d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/GetVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 783c920567425bd4c9385eeaf8099ea4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs new file mode 100644 index 00000000..a1688d5f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Returns Success if the collider hit another object, otherwise Failure.")] + public class HasColliderHit : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The tag of the GameObject to check for a collision against")] + public SharedString tag = ""; + [Tooltip("The object that started the collision")] + public SharedGameObject collidedGameObject; + + private bool enteredCollision = false; + + public override TaskStatus OnUpdate() + { + return enteredCollision ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + enteredCollision = false; + } + + public override void OnControllerColliderHit(ControllerColliderHit hit) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(hit.gameObject.tag)) { + collidedGameObject.Value = hit.gameObject; + enteredCollision = true; + } + } + + public override void OnReset() + { + targetGameObject = null; + tag = ""; + collidedGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs.meta new file mode 100644 index 00000000..947de51c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/HasColliderHit.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ff7c43d9df5279489455a4ce2eb3b20 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs new file mode 100644 index 00000000..4d480765 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Returns Success if the character is grounded, otherwise Failure.")] + public class IsGrounded : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + return characterController.isGrounded ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs.meta new file mode 100644 index 00000000..536c1fa8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/IsGrounded.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e8541a996b0a37b4f8bce82dd23ddb84 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs new file mode 100644 index 00000000..de40f1d2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("A more complex move function taking absolute movement deltas. Returns Success.")] + public class Move : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount to move")] + public SharedVector3 motion; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.Move(motion.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + motion = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs.meta new file mode 100644 index 00000000..00e7570e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/Move.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 546770f14f8265d4c83b94210630b644 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs new file mode 100644 index 00000000..c3aaac90 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Sets the center of the CharacterController. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CharacterController")] + public SharedVector3 center; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs.meta new file mode 100644 index 00000000..90d1e1c9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1072c5d1f7d15b24d811ee2e52f5806f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs new file mode 100644 index 00000000..7ad8e61c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Sets the height of the CharacterController. Returns Success.")] + public class SetHeight : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The height of the CharacterController")] + public SharedFloat height; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.height = height.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + height = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs.meta new file mode 100644 index 00000000..d42f0e0b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetHeight.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f3646fc892390f443ab43e4313cd0c6a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs new file mode 100644 index 00000000..53327f7d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Sets the radius of the CharacterController. Returns Success.")] + public class SetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CharacterController")] + public SharedFloat radius; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.radius = radius.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + radius = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs.meta new file mode 100644 index 00000000..8db23e47 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3d7c584aef3bd5468165685a1975862 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs new file mode 100644 index 00000000..ac860c57 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Sets the slope limit of the CharacterController. Returns Success.")] + public class SetSlopeLimit : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The slope limit of the CharacterController")] + public SharedFloat slopeLimit; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.slopeLimit = slopeLimit.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + slopeLimit = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs.meta new file mode 100644 index 00000000..aca63d5a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetSlopeLimit.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65d4ccec4c868584a89d9037a6eec3e6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs new file mode 100644 index 00000000..d646276d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Sets the step offset of the CharacterController. Returns Success.")] + public class SetStepOffset : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The step offset of the CharacterController")] + public SharedFloat stepOffset; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.stepOffset = stepOffset.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + stepOffset = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs.meta new file mode 100644 index 00000000..5512e7e7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SetStepOffset.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b062e83de9feb8a41a9e4989f2d65b97 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs new file mode 100644 index 00000000..7b999324 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCharacterController +{ + [TaskCategory("Basic/CharacterController")] + [TaskDescription("Moves the character with speed. Returns Success.")] + public class SimpleMove : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The speed of the movement")] + public SharedVector3 speed; + + private CharacterController characterController; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + characterController = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (characterController == null) { + Debug.LogWarning("CharacterController is null"); + return TaskStatus.Failure; + } + + characterController.SimpleMove(speed.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + speed = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs.meta new file mode 100644 index 00000000..f3a41a05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CharacterController/SimpleMove.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c760a29b8a35c044d87b7a80a58f046c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D.meta new file mode 100644 index 00000000..4f37223c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: e179f1af407aa8b469c6d96d7c0e2563 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs new file mode 100644 index 00000000..0dd214d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCircleCollider2D +{ + [TaskCategory("Basic/CircleCollider2D")] + [TaskDescription("Stores the center of the CircleCollider2D. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CircleCollider2D")] + [RequiredField] + public SharedVector2 storeValue; + + private CircleCollider2D circleCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + circleCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (circleCollider2D == null) { + Debug.LogWarning("CircleCollider2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = circleCollider2D.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector2.zero; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs.meta new file mode 100644 index 00000000..3224c185 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0b09bbd9fd4fbc44ba06b19dbb4cdd7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs new file mode 100644 index 00000000..a0940ef5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCircleCollider2D +{ + [TaskCategory("Basic/CircleCollider2D")] + [TaskDescription("Stores the radius of the CircleCollider2D. Returns Success.")] + public class GetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CircleCollider2D")] + [RequiredField] + public SharedFloat storeValue; + + private CircleCollider2D circleCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + circleCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (circleCollider2D == null) { + Debug.LogWarning("CircleCollider2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = circleCollider2D.radius; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs.meta new file mode 100644 index 00000000..17b98088 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/GetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5301adcc69414e44681c1d4dc7ecde58 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs new file mode 100644 index 00000000..41d5101c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCircleCollider2D +{ + [TaskCategory("Basic/CircleCollider2D")] + [TaskDescription("Sets the center of the CircleCollider2D. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the CircleCollider2D")] + public SharedVector2 center; + + private CircleCollider2D circleCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + circleCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (circleCollider2D == null) { + Debug.LogWarning("CircleCollider2D is null"); + return TaskStatus.Failure; + } + + circleCollider2D.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector2.zero; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs.meta new file mode 100644 index 00000000..9d3181d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 476937be0338dbf4c80b2a74a5d3ed8c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs new file mode 100644 index 00000000..44b51f3c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityCircleCollider2D +{ + [TaskCategory("Basic/CircleCollider2D")] + [TaskDescription("Sets the radius of the CircleCollider2D. Returns Success.")] + public class SetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the CircleCollider2D")] + public SharedFloat radius; + + private CircleCollider2D circleCollider2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + circleCollider2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (circleCollider2D == null) { + Debug.LogWarning("CircleCollider2D is null"); + return TaskStatus.Failure; + } + + circleCollider2D.radius = radius.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + radius = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs.meta new file mode 100644 index 00000000..51ed0fe3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/CircleCollider2D/SetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a9f837093c996864d95d92cae654a8ba +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug.meta new file mode 100644 index 00000000..a31d332b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: d1140cef910ebcb4fa9817c4ec7fe2df +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs new file mode 100644 index 00000000..2c5429fa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityDebug +{ + [TaskCategory("Basic/Debug")] + [TaskDescription("Draws a debug line")] + public class DrawLine : Action + { + [Tooltip("The start position")] + public SharedVector3 start; + [Tooltip("The end position")] + public SharedVector3 end; + [Tooltip("The color")] + public SharedColor color = Color.white; + + public override TaskStatus OnUpdate() + { + Debug.DrawLine(start.Value, end.Value, color.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + start = Vector3.zero; + end = Vector3.zero; + color = Color.white; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs.meta new file mode 100644 index 00000000..224373d4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawLine.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66a533f4f027ab44bb35e498d761ce50 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs new file mode 100644 index 00000000..81aa823f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityDebug +{ + [TaskCategory("Basic/Debug")] + [TaskDescription("Draws a debug ray")] + public class DrawRay : Action + { + [Tooltip("The position")] + public SharedVector3 start; + [Tooltip("The direction")] + public SharedVector3 direction; + [Tooltip("The color")] + public SharedColor color = Color.white; + + public override TaskStatus OnUpdate() + { + Debug.DrawRay(start.Value, direction.Value, color.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + start = Vector3.zero; + direction = Vector3.zero; + color = Color.white; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs.meta new file mode 100644 index 00000000..8490bb34 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/DrawRay.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 786ac0c09ce982e43b444670fdfe4c74 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs new file mode 100644 index 00000000..73605da8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityDebug +{ + [TaskCategory("Basic/Debug")] + [TaskDescription("Log a variable value.")] + public class LogValue : Action + { + [Tooltip("The variable to output")] + public SharedGenericVariable variable; + + public override TaskStatus OnUpdate() + { + Debug.Log(variable.Value.value.GetValue()); + + return TaskStatus.Success; + } + + public override void OnReset() + { + variable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs.meta new file mode 100644 index 00000000..03ab4247 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Debug/LogValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c50983a88995f4f4197f7b39ca796667 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject.meta new file mode 100644 index 00000000..df7ed0b9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: c03de85966f0a834383cef512841e4a9 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs new file mode 100644 index 00000000..e1beca39 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if the GameObject is active in the hierarchy, otherwise Failure.")] + public class ActiveInHierarchy : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).activeInHierarchy ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta new file mode 100644 index 00000000..10414adf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveInHierarchy.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bbe57db7a21ee94f86aef75bbcd6d18 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs new file mode 100644 index 00000000..37945765 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if the GameObject is active in the hierarchy, otherwise Failure.")] + public class ActiveSelf : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).activeSelf ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta new file mode 100644 index 00000000..a367c1b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/ActiveSelf.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26a4530d0ecaa774aaf060511089ddc3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs new file mode 100644 index 00000000..86e676af --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns Success if tags match, otherwise Failure.")] + public class CompareTag : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The tag to compare against")] + public SharedString tag; + + public override TaskStatus OnUpdate() + { + return GetDefaultGameObject(targetGameObject.Value).CompareTag(tag.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + tag = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta new file mode 100644 index 00000000..471d827f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/CompareTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa50c2eedc866794890ff361bdd1d593 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs new file mode 100644 index 00000000..659157b5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs @@ -0,0 +1,32 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Destorys the specified GameObject. Returns Success.")] + public class Destroy : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time to destroy the GameObject in")] + public float time; + + public override TaskStatus OnUpdate() + { + var destroyGameObject = GetDefaultGameObject(targetGameObject.Value); + if (time == 0) { + GameObject.Destroy(destroyGameObject); + } else { + GameObject.Destroy(destroyGameObject, time); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta new file mode 100644 index 00000000..0426b237 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Destroy.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42a90ad4cba90604b8be494aa74df349 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs new file mode 100644 index 00000000..22338483 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Destorys the specified GameObject immediately. Returns Success.")] + public class DestroyImmediate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + public override TaskStatus OnUpdate() + { + var destroyGameObject = GetDefaultGameObject(targetGameObject.Value); + GameObject.DestroyImmediate(destroyGameObject); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta new file mode 100644 index 00000000..dfca4dbd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/DestroyImmediate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81f8712bcbdbdbf4aad17ba5e1e20d8c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs new file mode 100644 index 00000000..067adeed --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by name. Returns Success.")] + public class Find : Action + { + [Tooltip("The GameObject name to find")] + public SharedString gameObjectName; + [Tooltip("The object found by name")] + [RequiredField] + public SharedGameObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GameObject.Find(gameObjectName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + gameObjectName = null; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta new file mode 100644 index 00000000..729c7c7d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Find.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5388c9a6fc7770f44885176c24f68aaa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs new file mode 100644 index 00000000..db02e1bd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by tag. Returns Success.")] + public class FindGameObjectsWithTag : Action + { + [Tooltip("The tag of the GameObject to find")] + public SharedString tag; + [Tooltip("The objects found by name")] + [RequiredField] + public SharedGameObjectList storeValue; + + public override TaskStatus OnUpdate() + { + var gameObjects = GameObject.FindGameObjectsWithTag(tag.Value); + for (int i = 0; i < gameObjects.Length; ++i) { + storeValue.Value.Add(gameObjects[i]); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + tag.Value = null; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta new file mode 100644 index 00000000..51a2649d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindGameObjectsWithTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccc3e1d2bf7cfc74089c17d593472f98 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs new file mode 100644 index 00000000..35a0ef63 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Finds a GameObject by tag. Returns Success.")] + public class FindWithTag : Action + { + [Tooltip("The tag of the GameObject to find")] + public SharedString tag; + [Tooltip("The object found by name")] + [RequiredField] + public SharedGameObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GameObject.FindWithTag(tag.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + tag.Value = null; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta new file mode 100644 index 00000000..c12ea132 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/FindWithTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d8768bdf841982f4aae662ee5dac3f2d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs new file mode 100644 index 00000000..96069ed8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Returns the component of Type type if the game object has one attached, null if it doesn't. Returns Success.")] + public class GetComponent : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The type of component")] + public SharedString type; + [Tooltip("The component")] + [RequiredField] + public SharedObject storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GetDefaultGameObject(targetGameObject.Value).GetComponent(type.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + type.Value = ""; + storeValue.Value = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta new file mode 100644 index 00000000..6d3bbf91 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetComponent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46e3dd9b1b260584b893abde5f733359 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs new file mode 100644 index 00000000..6392cb5c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Stores the GameObject tag. Returns Success.")] + public class GetTag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Active state of the GameObject")] + [RequiredField] + public SharedString storeValue; + + public override TaskStatus OnUpdate() + { + storeValue.Value = GetDefaultGameObject(targetGameObject.Value).tag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta new file mode 100644 index 00000000..03efe771 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/GetTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 44bf3273a8802dc408352f165f18c541 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs new file mode 100644 index 00000000..61f53469 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Instantiates a new GameObject. Returns Success.")] + public class Instantiate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the new GameObject")] + public SharedVector3 position; + [Tooltip("The rotation of the new GameObject")] + public SharedQuaternion rotation = Quaternion.identity; + [SharedRequired] + [Tooltip("The instantiated GameObject")] + public SharedGameObject storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = GameObject.Instantiate(targetGameObject.Value, position.Value, rotation.Value) as GameObject; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + rotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta new file mode 100644 index 00000000..fc324f10 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/Instantiate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 804a64515d87a0546ad7c6c4408ed53f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs new file mode 100644 index 00000000..87819e46 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Sends a message to the target GameObject. Returns Success.")] + public class SendMessage : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The message to send")] + public SharedString message; + [Tooltip("The value to send")] + public SharedGenericVariable value; + + public override TaskStatus OnUpdate() + { + if (value.Value != null) { + GetDefaultGameObject(targetGameObject.Value).SendMessage(message.Value, value.Value.value.GetValue()); + } else { + GetDefaultGameObject(targetGameObject.Value).SendMessage(message.Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + message = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta new file mode 100644 index 00000000..7eee6459 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SendMessage.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd0f144b1db34024eaea548f6539d2ae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs new file mode 100644 index 00000000..c3cbd84f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Activates/Deactivates the GameObject. Returns Success.")] + public class SetActive : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Active state of the GameObject")] + public SharedBool active; + + public override TaskStatus OnUpdate() + { + GetDefaultGameObject(targetGameObject.Value).SetActive(active.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + active = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta new file mode 100644 index 00000000..58907327 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetActive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5237a810dcce11e499c1915171ec670b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs new file mode 100644 index 00000000..d12ab6e4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityGameObject +{ + [TaskCategory("Basic/GameObject")] + [TaskDescription("Sets the GameObject tag. Returns Success.")] + public class SetTag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The GameObject tag")] + public SharedString tag; + + public override TaskStatus OnUpdate() + { + GetDefaultGameObject(targetGameObject.Value).tag = tag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + tag = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta new file mode 100644 index 00000000..6293b8dc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/GameObject/SetTag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e275477e6962d9b4fb90d7930bb6ff5a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input.meta new file mode 100644 index 00000000..cae43333 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 77642b8113f3f334d971d61be9516264 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs new file mode 100644 index 00000000..81c8be5c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the acceleration value.")] + public class GetAcceleration : Action + { + [RequiredField] + [Tooltip("The stored result")] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Input.acceleration; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs.meta new file mode 100644 index 00000000..46720f9c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAcceleration.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 06e82895d2abea24599ddfd6f0d7386a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs new file mode 100644 index 00000000..64dfc476 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs @@ -0,0 +1,45 @@ +using UnityEngine; +#if CROSS_PLATFORM_INPUT +using UnityStandardAssets.CrossPlatformInput; +#endif + + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the value of the specified axis and stores it in a float.")] + public class GetAxis : Action + { + [Tooltip("The name of the axis")] + public SharedString axisName; + [Tooltip("Axis values are in the range -1 to 1. Use the multiplier to set a larger range")] + public SharedFloat multiplier; + [RequiredField] + [Tooltip("The stored result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { +#if CROSS_PLATFORM_INPUT + var axisValue = CrossPlatformInputManager.GetAxis(axisName.Value); +#else + var axisValue = Input.GetAxis(axisName.Value); +#endif + + // if variable set to none, assume multiplier of 1 + if (!multiplier.IsNone) { + axisValue *= multiplier.Value; + } + + storeResult.Value = axisValue; + return TaskStatus.Success; + } + + public override void OnReset() + { + axisName = ""; + multiplier = 1.0f; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs.meta new file mode 100644 index 00000000..b15eb427 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxis.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84fa68d3aa9286f488ee60bb7f420079 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs new file mode 100644 index 00000000..4f3e8916 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs @@ -0,0 +1,44 @@ +using UnityEngine; +#if CROSS_PLATFORM_INPUT +using UnityStandardAssets.CrossPlatformInput; +#endif + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the raw value of the specified axis and stores it in a float.")] + public class GetAxisRaw : Action + { + [Tooltip("The name of the axis")] + public SharedString axisName; + [Tooltip("Axis values are in the range -1 to 1. Use the multiplier to set a larger range")] + public SharedFloat multiplier; + [RequiredField] + [Tooltip("The stored result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { +#if CROSS_PLATFORM_INPUT + var axisValue = CrossPlatformInputManager.GetAxisRaw(axisName.Value); +#else + var axisValue = Input.GetAxis(axisName.Value); +#endif + + // if variable set to none, assume multiplier of 1 + if (!multiplier.IsNone) { + axisValue *= multiplier.Value; + } + + storeResult.Value = axisValue; + return TaskStatus.Success; + } + + public override void OnReset() + { + axisName = ""; + multiplier = 1.0f; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs.meta new file mode 100644 index 00000000..9f0257dc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetAxisRaw.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7ba1768defe9ae4489e2d849801caf2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs new file mode 100644 index 00000000..16ca5592 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs @@ -0,0 +1,34 @@ +using UnityEngine; +#if CROSS_PLATFORM_INPUT +using UnityStandardAssets.CrossPlatformInput; +#endif + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the state of the specified button.")] + public class GetButton : Action + { + [Tooltip("The name of the button")] + public SharedString buttonName; + [RequiredField] + [Tooltip("The stored result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { +#if CROSS_PLATFORM_INPUT + storeResult.Value = CrossPlatformInputManager.GetButton(buttonName.Value); +#else + storeResult.Value = Input.GetButton(buttonName.Value); +#endif + return TaskStatus.Success; + } + + public override void OnReset() + { + buttonName = "Fire1"; + storeResult = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs.meta new file mode 100644 index 00000000..3f0dcc36 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetButton.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ca2e1ded24b0a144b628bb8ed81ccd0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs new file mode 100644 index 00000000..5fd8807a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the pressed state of the specified key.")] + public class GetKey : Action + { + [Tooltip("The key to test.")] + public KeyCode key; + [RequiredField] + [Tooltip("The stored result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Input.GetKey(key); + return TaskStatus.Success; + } + + public override void OnReset() + { + key = KeyCode.None; + storeResult = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs.meta new file mode 100644 index 00000000..250f6552 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8d91595c5c003b948abb908c7465a7ec +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs new file mode 100644 index 00000000..2ffab1fd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the state of the specified mouse button.")] + public class GetMouseButton : Action + { + [Tooltip("The index of the button")] + public SharedInt buttonIndex; + [RequiredField] + [Tooltip("The stored result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Input.GetMouseButton(buttonIndex.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + buttonIndex = 0; + storeResult = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs.meta new file mode 100644 index 00000000..bef0000b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMouseButton.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3449e6301a95d9e49a8f6b50ef862faa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs new file mode 100644 index 00000000..c77718c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Stores the mouse position.")] + public class GetMousePosition : Action + { + [RequiredField] + [Tooltip("The stored result")] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Input.mousePosition; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs.meta new file mode 100644 index 00000000..6909b9e2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/GetMousePosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f11dbb85cfc5b3941ae4f82fa54b7d27 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs new file mode 100644 index 00000000..9fd532f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs @@ -0,0 +1,29 @@ +using UnityEngine; +#if CROSS_PLATFORM_INPUT +using UnityStandardAssets.CrossPlatformInput; +#endif + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified button is pressed.")] + public class IsButtonDown : Conditional + { + [Tooltip("The name of the button")] + public SharedString buttonName; + + public override TaskStatus OnUpdate() + { +#if CROSS_PLATFORM_INPUT + return CrossPlatformInputManager.GetButtonDown(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure; +#else + return Input.GetButtonDown(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure; +#endif + } + + public override void OnReset() + { + buttonName = "Fire1"; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs.meta new file mode 100644 index 00000000..82b95089 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonDown.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 554c281a83ae5bb4bbcdf3bdeac6779e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs new file mode 100644 index 00000000..6278ceb5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs @@ -0,0 +1,29 @@ +using UnityEngine; +#if CROSS_PLATFORM_INPUT +using UnityStandardAssets.CrossPlatformInput; +#endif + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified button is released.")] + public class IsButtonUp : Conditional + { + [Tooltip("The name of the button")] + public SharedString buttonName; + + public override TaskStatus OnUpdate() + { +#if CROSS_PLATFORM_INPUT + return CrossPlatformInputManager.GetButtonUp(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure; +#else + return Input.GetButtonUp(buttonName.Value) ? TaskStatus.Success : TaskStatus.Failure; +#endif + } + + public override void OnReset() + { + buttonName = "Fire1"; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs.meta new file mode 100644 index 00000000..5326dcbc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsButtonUp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 71d9dda886873b943922eae52da81244 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs new file mode 100644 index 00000000..f1fe4100 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified key is pressed.")] + public class IsKeyDown : Conditional + { + [Tooltip("The key to test")] + public KeyCode key; + + public override TaskStatus OnUpdate() + { + return Input.GetKeyDown(key) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + key = KeyCode.None; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs.meta new file mode 100644 index 00000000..bffece71 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyDown.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4c02f1f071b9604389e1c1f1bfab3eb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs new file mode 100644 index 00000000..ddeb76f8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified key is released.")] + public class IsKeyUp : Conditional + { + [Tooltip("The key to test")] + public KeyCode key; + + public override TaskStatus OnUpdate() + { + return Input.GetKeyUp(key) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + key = KeyCode.None; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs.meta new file mode 100644 index 00000000..bbca872f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsKeyUp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d8622d5540c851448ad036016f0f426 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs new file mode 100644 index 00000000..573d6266 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified mouse button is pressed.")] + public class IsMouseDown : Conditional + { + [Tooltip("The button index")] + public SharedInt buttonIndex; + + public override TaskStatus OnUpdate() + { + return Input.GetMouseButtonDown(buttonIndex.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + buttonIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs.meta new file mode 100644 index 00000000..63169ed0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseDown.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd85264410cd9ac45b0c9c2e550f7c46 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs new file mode 100644 index 00000000..157474d1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityInput +{ + [TaskCategory("Basic/Input")] + [TaskDescription("Returns success when the specified mouse button is pressed.")] + public class IsMouseUp : Conditional + { + [Tooltip("The button index")] + public SharedInt buttonIndex; + + public override TaskStatus OnUpdate() + { + return Input.GetMouseButtonUp(buttonIndex.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + buttonIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs.meta new file mode 100644 index 00000000..8d3608bf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Input/IsMouseUp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b2ecc8718d19d9b46832c51de0390245 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask.meta new file mode 100644 index 00000000..a0aceb57 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 03592e079804666408280a195c972a69 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs new file mode 100644 index 00000000..032e47be --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLayerMask +{ + [TaskCategory("Basic/LayerMask")] + [TaskDescription("Gets the layer of a GameObject.")] + public class GetLayer : Action + { + [Tooltip("The GameObject to set the layer of")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the layer to get")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + storeResult.Value = LayerMask.LayerToName(currentGameObject.layer); + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs.meta new file mode 100644 index 00000000..3b4d954c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/GetLayer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a7e0974f9cfb9945bb2d0f41ed55f10 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs new file mode 100644 index 00000000..09f218d6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLayerMask +{ + [TaskCategory("Basic/LayerMask")] + [TaskDescription("Sets the layer of a GameObject.")] + public class SetLayer : Action + { + [Tooltip("The GameObject to set the layer of")] + public SharedGameObject targetGameObject; + [Tooltip("The name of the layer to set")] + public SharedString layerName = "Default"; + + public override TaskStatus OnUpdate() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + currentGameObject.layer = LayerMask.NameToLayer(layerName.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + layerName = "Default"; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs.meta new file mode 100644 index 00000000..f57d1cd8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/LayerMask/SetLayer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 483904cd6081c8440a146b11481d6623 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light.meta new file mode 100644 index 00000000..e8393d1f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 48823f7ab681c2b4f9439c617555cf7a +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs new file mode 100644 index 00000000..29a084c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the color of the light.")] + public class GetColor : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The color to store")] + public SharedColor storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.color; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Color.white; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta new file mode 100644 index 00000000..c391a19f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 935c3e08c991a524fa451ba010bb7077 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs new file mode 100644 index 00000000..85dfd53b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the light's cookie size.")] + public class GetCookieSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The size to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.cookieSize; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta new file mode 100644 index 00000000..a86579e2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetCookieSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4c382d40893d45d46842714355d4cab4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs new file mode 100644 index 00000000..7ee3f1b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the intensity of the light.")] + public class GetIntensity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The intensity to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.intensity; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta new file mode 100644 index 00000000..dfad40c2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetIntensity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8af031ee741aec645bcf65ae806e78a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs new file mode 100644 index 00000000..3156c745 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the range of the light.")] + public class GetRange : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The range to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.range; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta new file mode 100644 index 00000000..220a3c67 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetRange.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ebab1924e0212c4ca589526a033fda6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs new file mode 100644 index 00000000..796f4fe0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the shadow bias of the light.")] + public class GetShadowBias : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The shadow bias to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.shadowBias; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta new file mode 100644 index 00000000..7b99160f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowBias.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d0cbb27de892b44193aaa9f12842ed2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs new file mode 100644 index 00000000..be58b1c9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the color of the light.")] + public class GetShadowSoftness : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The color to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.shadowSoftness; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta new file mode 100644 index 00000000..3121127e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftness.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d9f46302c54f694684428de8562238e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs new file mode 100644 index 00000000..7df7ed4b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the color of the light.")] + public class GetShadowSoftnessFade : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The color to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.shadowSoftnessFade; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta new file mode 100644 index 00000000..33b3ec32 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowSoftnessFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 070cb15a90d2ab3458792de8fdf6eae9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs new file mode 100644 index 00000000..81e3ca68 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the color of the light.")] + public class GetShadowStrength : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The color to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.shadowStrength; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta new file mode 100644 index 00000000..76739e89 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetShadowStrength.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a7fe83e412ff344888939e6a974a064 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs new file mode 100644 index 00000000..d6b98562 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Stores the spot angle of the light.")] + public class GetSpotAngle : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [RequiredField] + [Tooltip("The spot angle to store")] + public SharedFloat storeValue; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + storeValue = light.spotAngle; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta new file mode 100644 index 00000000..74436066 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/GetSpotAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4dfc8df823e06cd45a09d929a060f99d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs new file mode 100644 index 00000000..43232caf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the color of the light.")] + public class SetColor : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The color to set")] + public SharedColor color; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.color = color.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + color = Color.white; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta new file mode 100644 index 00000000..403db7c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ba683b0b18385042b3351c660f29d33 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs new file mode 100644 index 00000000..5037c250 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the cookie of the light.")] + public class SetCookie : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The cookie to set")] + public Texture2D cookie; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.cookie = cookie; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + cookie = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta new file mode 100644 index 00000000..ad8cc7b0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookie.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 374f9a87dc387a04585b87f187d019c5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs new file mode 100644 index 00000000..b70581e3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the light's cookie size.")] + public class SetCookieSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The size to set")] + public SharedFloat cookieSize; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.cookieSize = cookieSize.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + cookieSize = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta new file mode 100644 index 00000000..e06f1769 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCookieSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fbc2d3865f928144ea551b1d927ddc96 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs new file mode 100644 index 00000000..5f6ef3e2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the culling mask of the light.")] + public class SetCullingMask : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The culling mask to set")] + public LayerMask cullingMask; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.cullingMask = cullingMask.value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + cullingMask = -1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta new file mode 100644 index 00000000..8968b4e5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetCullingMask.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f67673818b7e914ebf088b3752d716b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs new file mode 100644 index 00000000..9bbf21c8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the intensity of the light.")] + public class SetIntensity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The intensity to set")] + public SharedFloat intensity; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.intensity = intensity.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + intensity = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta new file mode 100644 index 00000000..137b45cd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetIntensity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f32aa9b9681f0a4285bd60ac0607d00 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs new file mode 100644 index 00000000..975421ee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the range of the light.")] + public class SetRange : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The range to set")] + public SharedFloat range; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.range = range.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + range = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta new file mode 100644 index 00000000..d2bb5bd3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetRange.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f0b5d0c0a07806244a3c5b15e29cf90c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs new file mode 100644 index 00000000..b286c041 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the shadow bias of the light.")] + public class SetShadowBias : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The shadow bias to set")] + public SharedFloat shadowBias; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.shadowBias = shadowBias.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + shadowBias = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta new file mode 100644 index 00000000..c364894d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowBias.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2b374e3c2e26e94ba76dd68290ff538 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs new file mode 100644 index 00000000..1f9122e8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the shadow softness of the light.")] + public class SetShadowSoftness : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The shadow softness to set")] + public SharedFloat shadowSoftness; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.shadowSoftness = shadowSoftness.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + shadowSoftness = 0; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta new file mode 100644 index 00000000..1276066d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftness.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca82eb780880d17499dc6de132631073 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs new file mode 100644 index 00000000..2c5047f0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the shadow softness fade value of the light.")] + public class SetShadowSoftnessFade : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The shadow softness fade to set")] + public SharedFloat shadowSoftnessFade; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.shadowSoftnessFade = shadowSoftnessFade.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + shadowSoftnessFade = 0; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta new file mode 100644 index 00000000..074f1119 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowSoftnessFade.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e7db120bd152164eb6d586a39e53175 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs new file mode 100644 index 00000000..b30cf243 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the shadow strength of the light.")] + public class SetShadowSoftnessStrength : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The shadow strength to set")] + public SharedFloat shadowStrength; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.shadowStrength = shadowStrength.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + shadowStrength = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta new file mode 100644 index 00000000..f5ba4379 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadowStrength.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 611e5846c0413be46bbc44fbd256b4e9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs new file mode 100644 index 00000000..8310dd27 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the shadow type of the light.")] + public class SetShadows : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The shadow type to set")] + public LightShadows shadows; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.shadows = shadows; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta new file mode 100644 index 00000000..f528500b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetShadows.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6226eb03ad729445bc7ccfb1f0cd89d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs new file mode 100644 index 00000000..f017a652 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the spot angle of the light.")] + public class SetSpotAngle : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The spot angle to set")] + public SharedFloat spotAngle; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.spotAngle = spotAngle.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + spotAngle = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta new file mode 100644 index 00000000..b6d09a90 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetSpotAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a8b9b0654618fe48953e059d4aa5ee3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs new file mode 100644 index 00000000..2d103ed9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityLight +{ + [TaskCategory("Basic/Light")] + [TaskDescription("Sets the type of the light.")] + public class SetType : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The type to set")] + public LightType type; + + // cache the light component + private Light light; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + light = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (light == null) { + Debug.LogWarning("Light is null"); + return TaskStatus.Failure; + } + + light.type = type; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta new file mode 100644 index 00000000..c0ba834c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Light/SetType.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 85cae5f82bfcbfb41ac7c66464eef85f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math.meta new file mode 100644 index 00000000..e1b082b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: fffa44303fdbffe4289373d6e5087b4a +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs new file mode 100644 index 00000000..bc351241 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs a comparison between two bools.")] + public class BoolComparison : Conditional + { + [Tooltip("The first bool")] + public SharedBool bool1; + [Tooltip("The second bool")] + public SharedBool bool2; + + public override TaskStatus OnUpdate() + { + return bool1.Value == bool2.Value ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + bool1.Value = false; + bool2.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta new file mode 100644 index 00000000..ec4e2beb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: abaa3d78e68f249428f3be7acae86b0d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs new file mode 100644 index 00000000..3067ffdd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Flips the value of the bool.")] + public class BoolFlip : Action + { + [Tooltip("The bool to flip the value of")] + public SharedBool boolVariable; + + public override TaskStatus OnUpdate() + { + boolVariable.Value = !boolVariable.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + boolVariable.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta new file mode 100644 index 00000000..44658dae --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolFlip.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54aae1e47fe3be6458751bf1f9defe8f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs new file mode 100644 index 00000000..dddb3db6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs @@ -0,0 +1,53 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs a math operation on two bools: AND, OR, NAND, or XOR.")] + public class BoolOperator : Action + { + public enum Operation + { + AND, + OR, + NAND, + XOR + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first bool")] + public SharedBool bool1; + [Tooltip("The second bool")] + public SharedBool bool2; + [Tooltip("The variable to store the result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.AND: + storeResult.Value = bool1.Value && bool2.Value; + break; + case Operation.OR: + storeResult.Value = bool1.Value || bool2.Value; + break; + case Operation.NAND: + storeResult.Value = !(bool1.Value && bool2.Value); + break; + case Operation.XOR: + storeResult.Value = bool1.Value ^ bool2.Value; + break; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + operation = Operation.AND; + bool1.Value = false; + bool2.Value = false; + storeResult.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta new file mode 100644 index 00000000..7b4a9b28 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/BoolOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd7b9dfddd114be4a8c8a8521262970d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs new file mode 100644 index 00000000..16c2e345 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Stores the absolute value of the float.")] + public class FloatAbs : Action + { + [Tooltip("The float to return the absolute value of")] + public SharedFloat floatVariable; + + public override TaskStatus OnUpdate() + { + floatVariable.Value = Mathf.Abs(floatVariable.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + floatVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta new file mode 100644 index 00000000..805bd7e7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatAbs.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab5531c4ed335b643a6f310c048a6b00 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs new file mode 100644 index 00000000..89f406b9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Clamps the float between two values.")] + public class FloatClamp : Action + { + [Tooltip("The float to clamp")] + public SharedFloat floatVariable; + [Tooltip("The maximum value of the float")] + public SharedFloat minValue; + [Tooltip("The maximum value of the float")] + public SharedFloat maxValue; + + public override TaskStatus OnUpdate() + { + floatVariable.Value = Mathf.Clamp(floatVariable.Value, minValue.Value, maxValue.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + floatVariable = minValue = maxValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta new file mode 100644 index 00000000..dbe8a35c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatClamp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 75c3634f2c8f1dd49b826a7ac0c7bdbe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs new file mode 100644 index 00000000..b64d25c1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs @@ -0,0 +1,52 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs comparison between two floats: less than, less than or equal to, equal to, not equal to, greater than or equal to, or greater than.")] + public class FloatComparison : Conditional + { + public enum Operation + { + LessThan, + LessThanOrEqualTo, + EqualTo, + NotEqualTo, + GreaterThanOrEqualTo, + GreaterThan + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first float")] + public SharedFloat float1; + [Tooltip("The second float")] + public SharedFloat float2; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.LessThan: + return float1.Value < float2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.LessThanOrEqualTo: + return float1.Value <= float2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.EqualTo: + return float1.Value == float2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.NotEqualTo: + return float1.Value != float2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.GreaterThanOrEqualTo: + return float1.Value >= float2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.GreaterThan: + return float1.Value > float2.Value ? TaskStatus.Success : TaskStatus.Failure; + } + return TaskStatus.Failure; + } + + public override void OnReset() + { + operation = Operation.LessThan; + float1.Value = 0; + float2.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta new file mode 100644 index 00000000..f4f6d874 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 79c81f4e67dbdc44880734e78153117c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs new file mode 100644 index 00000000..9c4b249f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs @@ -0,0 +1,61 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs a math operation on two floats: Add, Subtract, Multiply, Divide, Min, or Max.")] + public class FloatOperator : Action + { + public enum Operation + { + Add, + Subtract, + Multiply, + Divide, + Min, + Max + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first float")] + public SharedFloat float1; + [Tooltip("The second float")] + public SharedFloat float2; + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.Add: + storeResult.Value = float1.Value + float2.Value; + break; + case Operation.Subtract: + storeResult.Value = float1.Value - float2.Value; + break; + case Operation.Multiply: + storeResult.Value = float1.Value * float2.Value; + break; + case Operation.Divide: + storeResult.Value = float1.Value / float2.Value; + break; + case Operation.Min: + storeResult.Value = Mathf.Min(float1.Value, float2.Value); + break; + case Operation.Max: + storeResult.Value = Mathf.Max(float1.Value, float2.Value); + break; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + operation = Operation.Add; + float1.Value = 0; + float2.Value = 0; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta new file mode 100644 index 00000000..1641d6ce --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/FloatOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9144ac2a8b796c941aeb3d6a4bc2cf7c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs new file mode 100644 index 00000000..05f97250 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Stores the absolute value of the int.")] + public class IntAbs : Action + { + [Tooltip("The int to return the absolute value of")] + public SharedInt intVariable; + + public override TaskStatus OnUpdate() + { + intVariable.Value = Mathf.Abs(intVariable.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + intVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta new file mode 100644 index 00000000..b3363f74 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntAbs.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8edcbab77068fe044842381cfe0acc19 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs new file mode 100644 index 00000000..fed3a146 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Clamps the int between two values.")] + public class IntClamp : Action + { + [Tooltip("The int to clamp")] + public SharedInt intVariable; + [Tooltip("The maximum value of the int")] + public SharedInt minValue; + [Tooltip("The maximum value of the int")] + public SharedInt maxValue; + + public override TaskStatus OnUpdate() + { + intVariable.Value = Mathf.Clamp(intVariable.Value, minValue.Value, maxValue.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + intVariable = minValue = maxValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta new file mode 100644 index 00000000..c1bf1d66 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntClamp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 67cbe30015f2b4940a069cbbee22d888 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs new file mode 100644 index 00000000..bcef3078 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs @@ -0,0 +1,52 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs comparison between two integers: less than, less than or equal to, equal to, not equal to, greater than or equal to, or greater than.")] + public class IntComparison : Conditional + { + public enum Operation + { + LessThan, + LessThanOrEqualTo, + EqualTo, + NotEqualTo, + GreaterThanOrEqualTo, + GreaterThan + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first integer")] + public SharedInt integer1; + [Tooltip("The second integer")] + public SharedInt integer2; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.LessThan: + return integer1.Value < integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.LessThanOrEqualTo: + return integer1.Value <= integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.EqualTo: + return integer1.Value == integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.NotEqualTo: + return integer1.Value != integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.GreaterThanOrEqualTo: + return integer1.Value >= integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + case Operation.GreaterThan: + return integer1.Value > integer2.Value ? TaskStatus.Success : TaskStatus.Failure; + } + return TaskStatus.Failure; + } + + public override void OnReset() + { + operation = Operation.LessThan; + integer1.Value = 0; + integer2.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta new file mode 100644 index 00000000..e8807d6b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntComparison.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99108c35b6d8e9942b8cf441a63f97b5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs new file mode 100644 index 00000000..4805508e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs @@ -0,0 +1,62 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Performs a math operation on two integers: Add, Subtract, Multiply, Divide, Min, or Max.")] + public class IntOperator : Action + { + public enum Operation + { + Add, + Subtract, + Multiply, + Divide, + Min, + Max + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first integer")] + public SharedInt integer1; + [Tooltip("The second integer")] + public SharedInt integer2; + [RequiredField] + [Tooltip("The variable to store the result")] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.Add: + storeResult.Value = integer1.Value + integer2.Value; + break; + case Operation.Subtract: + storeResult.Value = integer1.Value - integer2.Value; + break; + case Operation.Multiply: + storeResult.Value = integer1.Value * integer2.Value; + break; + case Operation.Divide: + storeResult.Value = integer1.Value / integer2.Value; + break; + case Operation.Min: + storeResult.Value = Mathf.Min(integer1.Value, integer2.Value); + break; + case Operation.Max: + storeResult.Value = Mathf.Max(integer1.Value, integer2.Value); + break; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + operation = Operation.Add; + integer1.Value = 0; + integer2.Value = 0; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta new file mode 100644 index 00000000..fc1fa364 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IntOperator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84208004fb80c0945acc5685aa0a2681 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs new file mode 100644 index 00000000..b1a9f3e4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Is the float a positive value?")] + public class IsFloatPositive : Conditional + { + [Tooltip("The float to check if positive")] + public SharedFloat floatVariable; + + public override TaskStatus OnUpdate() + { + return floatVariable.Value > 0 ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + floatVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta new file mode 100644 index 00000000..6502aa63 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsFloatPositive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db01d0da1f282134ca0ff7332eb19208 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs new file mode 100644 index 00000000..433e60f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Is the int a positive value?")] + public class IsIntPositive : Conditional + { + [Tooltip("The int to check if positive")] + public SharedInt intVariable; + + public override TaskStatus OnUpdate() + { + return intVariable.Value > 0 ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + intVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta new file mode 100644 index 00000000..0fd5bd95 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/IsIntPositive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0caff63c23ae17343a455fcbe6eab40a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs new file mode 100644 index 00000000..1e39179c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Lerp the float by an amount.")] + public class Lerp : Action + { + [Tooltip("The from value")] + public SharedFloat fromValue; + [Tooltip("The to value")] + public SharedFloat toValue; + [Tooltip("The amount to lerp")] + public SharedFloat lerpAmount; + [Tooltip("The lerp resut")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Mathf.Lerp(fromValue.Value, toValue.Value, lerpAmount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromValue = toValue = lerpAmount = storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta new file mode 100644 index 00000000..b6e18c51 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/Lerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 355f3f83182cc434cb3a1bfb66862e29 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs new file mode 100644 index 00000000..11cd8165 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Lerp the angle by an amount.")] + public class LerpAngle : Action + { + [Tooltip("The from value")] + public SharedFloat fromValue; + [Tooltip("The to value")] + public SharedFloat toValue; + [Tooltip("The amount to lerp")] + public SharedFloat lerpAmount; + [Tooltip("The lerp resut")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Mathf.LerpAngle(fromValue.Value, toValue.Value, lerpAmount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromValue = toValue = lerpAmount = storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta new file mode 100644 index 00000000..6b5fc782 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/LerpAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3b148edcb926b744a2bb789f7967e24 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs new file mode 100644 index 00000000..2cb731d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets a random bool value")] + public class RandomBool : Action + { + [Tooltip("The variable to store the result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Random.value < 0.5f; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta new file mode 100644 index 00000000..e666e5ed --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76d2565ca99ca26459dbefb44dcac109 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs new file mode 100644 index 00000000..57ca24f8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs @@ -0,0 +1,36 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets a random float value")] + public class RandomFloat : Action + { + [Tooltip("The minimum amount")] + public SharedFloat min; + [Tooltip("The maximum amount")] + public SharedFloat max; + [Tooltip("Is the maximum value inclusive?")] + public bool inclusive; + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + if (inclusive) { + storeResult.Value = Random.Range(min.Value, max.Value + 1); + } else { + storeResult.Value = Random.Range(min.Value, max.Value); + } + return TaskStatus.Success; + } + + public override void OnReset() + { + min.Value = 0; + max.Value = 0; + inclusive = false; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta new file mode 100644 index 00000000..9b1e5fc8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f81e111c77731b418178f1226975c3f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs new file mode 100644 index 00000000..6fa4db81 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs @@ -0,0 +1,36 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets a random int value")] + public class RandomInt : Action + { + [Tooltip("The minimum amount")] + public SharedInt min; + [Tooltip("The maximum amount")] + public SharedInt max; + [Tooltip("Is the maximum value inclusive?")] + public bool inclusive; + [Tooltip("The variable to store the result")] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + if (inclusive) { + storeResult.Value = Random.Range(min.Value, max.Value + 1); + } else { + storeResult.Value = Random.Range(min.Value, max.Value); + } + return TaskStatus.Success; + } + + public override void OnReset() + { + min.Value = 0; + max.Value = 0; + inclusive = false; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta new file mode 100644 index 00000000..2d3efdac --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/RandomInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 067384c41f33cff49bcdf6adec9da049 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs new file mode 100644 index 00000000..6cde489c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets a bool value")] + public class SetBool : Action + { + [Tooltip("The bool value to set")] + public SharedBool boolValue; + [Tooltip("The variable to store the result")] + public SharedBool storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = boolValue.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + boolValue.Value = false; + storeResult.Value = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta new file mode 100644 index 00000000..33f077c7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 55f244424a532d24bba59542e2f0fc59 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs new file mode 100644 index 00000000..a4c97c32 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets a float value")] + public class SetFloat : Action + { + [Tooltip("The float value to set")] + public SharedFloat floatValue; + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = floatValue.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + floatValue.Value = 0; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta new file mode 100644 index 00000000..794328f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d915065ba447c64ba05f8e2841c6efd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs new file mode 100644 index 00000000..210b6452 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.Math +{ + [TaskCategory("Basic/Math")] + [TaskDescription("Sets an int value")] + public class SetInt : Action + { + [Tooltip("The int value to set")] + public SharedInt intValue; + [Tooltip("The variable to store the result")] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = intValue.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + intValue.Value = 0; + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta new file mode 100644 index 00000000..c5a42a46 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Math/SetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da57a0a43f227e445b9311bae043401f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network.meta new file mode 100644 index 00000000..7226ca30 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 5c6c53ae71570844abe4d526c0f67273 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs new file mode 100644 index 00000000..526834b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs @@ -0,0 +1,15 @@ +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0) +using UnityEngine; +using UnityEngine.Networking; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityNetwork +{ + public class IsClient : Conditional + { + public override TaskStatus OnUpdate() + { + return NetworkClient.active ? TaskStatus.Success : TaskStatus.Failure; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs.meta new file mode 100644 index 00000000..f495c42c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsClient.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0762b2157086f9f43a3345a2afec412f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs new file mode 100644 index 00000000..81a4027b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs @@ -0,0 +1,15 @@ +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0) +using UnityEngine; +using UnityEngine.Networking; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityNetwork +{ + public class IsServer : Conditional + { + public override TaskStatus OnUpdate() + { + return NetworkServer.active ? TaskStatus.Success : TaskStatus.Failure; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs.meta new file mode 100644 index 00000000..db422e8a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Network/IsServer.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7cf87bcdeb87b54698789a35a4b8ff0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem.meta new file mode 100644 index 00000000..9b1569a6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 298b24307673c7a49b5cabe1dbcae115 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs new file mode 100644 index 00000000..38988c82 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Clear the Particle System.")] + public class Clear : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.Clear(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs.meta new file mode 100644 index 00000000..63db0e0c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Clear.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de273e542591d5946a8728190438ae27 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs new file mode 100644 index 00000000..304497d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the duration of the Particle System.")] + public class GetDuration : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The duration of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.main.duration; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs.meta new file mode 100644 index 00000000..f41e7cee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetDuration.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 02a4d610e82f1854c87701c4d51957fb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs new file mode 100644 index 00000000..c13c0470 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the emission rate of the Particle System.")] + public class GetEmissionRate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The emission rate of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) + Debug.Log("Warning: GetEmissionRate is not used in Unity 5.3 or later."); +#else + storeResult.Value = particleSystem.emissionRate; +#endif + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs.meta new file mode 100644 index 00000000..1658d847 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEmissionRate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3adb98115d27ec64da9b5f56391570be +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs new file mode 100644 index 00000000..f0a01b0e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores if the Particle System is emitting particles.")] + public class GetEnableEmission : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Is the Particle System emitting particles?")] + [RequiredField] + public SharedBool storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) + storeResult.Value = particleSystem.emission.enabled; +#else + storeResult.Value = particleSystem.enableEmission; +#endif + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs.meta new file mode 100644 index 00000000..e894a6e4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetEnableEmission.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81dc1a241a2c872409a7919742df7581 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs new file mode 100644 index 00000000..d967061a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the gravity modifier of the Particle System.")] + public class GetGravityModifier : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The gravity modifier of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.main.gravityModifierMultiplier; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs.meta new file mode 100644 index 00000000..3412f534 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetGravityModifier.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7001d2ab41ef4e64190afc7f9bce1876 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs new file mode 100644 index 00000000..aea4858e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores if the Particle System should loop.")] + public class GetLoop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Should the ParticleSystem loop?")] + [RequiredField] + public SharedBool storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.main.loop; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs.meta new file mode 100644 index 00000000..bfa703a0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetLoop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82f4ee8cf50887a4488fe6d0da18afc0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs new file mode 100644 index 00000000..7e71ccc0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the max particles of the Particle System.")] + public class GetMaxParticles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The max particles of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.main.maxParticles; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs.meta new file mode 100644 index 00000000..8e026028 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetMaxParticles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 429771af65df81c49aaf4b34630473fe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs new file mode 100644 index 00000000..06c4fe96 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the particle count of the Particle System.")] + public class GetParticleCount : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The particle count of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.particleCount; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs.meta new file mode 100644 index 00000000..c1cfbc05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetParticleCount.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f32e2ff9de4ff7b47a256ac3b51123c6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs new file mode 100644 index 00000000..37b3e620 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the playback speed of the Particle System.")] + public class GetPlaybackSpeed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The playback speed of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.main.simulationSpeed; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs.meta new file mode 100644 index 00000000..12e27063 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetPlaybackSpeed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8f29f170ac706b498e7c933136d8036 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs new file mode 100644 index 00000000..315474d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stores the time of the Particle System.")] + public class GetTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The time of the ParticleSystem")] + [RequiredField] + public SharedFloat storeResult; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + storeResult.Value = particleSystem.time; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs.meta new file mode 100644 index 00000000..0cd924dc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/GetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b15c7efbf98f7649adf8dd4474b0579 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs new file mode 100644 index 00000000..49f56b98 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Is the Particle System alive?")] + public class IsAlive : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + return particleSystem.IsAlive() ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs.meta new file mode 100644 index 00000000..aa294a13 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsAlive.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d554784e9a9fa040a2446402ba3f10e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs new file mode 100644 index 00000000..d0180464 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Is the Particle System paused?")] + public class IsPaused : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + return particleSystem.isPaused ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs.meta new file mode 100644 index 00000000..00a5c85f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPaused.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e4e9ab132f20dfa4095b3c90303ebf74 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs new file mode 100644 index 00000000..ee9f9472 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Is the Particle System playing?")] + public class IsPlaying : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + return particleSystem.isPlaying ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs.meta new file mode 100644 index 00000000..d3f13e4d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsPlaying.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 654b51e99f64bfb489e12866a569f00e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs new file mode 100644 index 00000000..39642507 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Is the Particle System stopped?")] + public class IsStopped : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + return particleSystem.isStopped ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs.meta new file mode 100644 index 00000000..d0a054fb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/IsStopped.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c719a7379c22b184380b4e63ccdfd064 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs new file mode 100644 index 00000000..496b2db5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Pause the Particle System.")] + public class Pause : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.Pause(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs.meta new file mode 100644 index 00000000..d6e60239 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Pause.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9c9cc56691817b49af4fd1cfbc3e363 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs new file mode 100644 index 00000000..6797351c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Play the Particle System.")] + public class Play : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.Play(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs.meta new file mode 100644 index 00000000..276c73c4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Play.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8ffb889d35074d4fb08d8502155c0b2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs new file mode 100644 index 00000000..c0d7a6d4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the emission rate of the Particle System.")] + public class SetEmissionRate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The emission rate of the ParticleSystem")] + public SharedFloat emissionRate; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) + Debug.Log("Warning: SetEmissionRate is not used in Unity 5.3 or later."); +#else + particleSystem.emissionRate = emissionRate.Value; +#endif + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + emissionRate = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs.meta new file mode 100644 index 00000000..ac56602a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEmissionRate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8300eee629ad77419f2eb91477a0b62 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs new file mode 100644 index 00000000..1c47207e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Enables or disables the Particle System emission.")] + public class SetEnableEmission : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Enable the ParticleSystem emissions?")] + public SharedBool enable; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + +#if !(UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2) + var emission = particleSystem.emission; + emission.enabled = enable.Value; +#else + particleSystem.enableEmission = enable.Value; +#endif + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + enable = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs.meta new file mode 100644 index 00000000..d5d77a69 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetEnableEmission.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7c295b4d24628146a885d21bf699993 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs new file mode 100644 index 00000000..1082989d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the gravity modifier of the Particle System.")] + public class SetGravityModifier : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The gravity modifier of the ParticleSystem")] + public SharedFloat gravityModifier; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.gravityModifierMultiplier = gravityModifier.Value; + //particleSystem.main = main; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + gravityModifier = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs.meta new file mode 100644 index 00000000..8337a101 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetGravityModifier.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1a6694791042df4ea2097a2508bd8de +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs new file mode 100644 index 00000000..8706fe53 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets if the Particle System should loop.")] + public class SetLoop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Should the ParticleSystem loop?")] + public SharedBool loop; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.loop = loop.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + loop = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs.meta new file mode 100644 index 00000000..169ffad8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetLoop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b9fa90adc0377cc4592de00e410a4060 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs new file mode 100644 index 00000000..a1d8730a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the max particles of the Particle System.")] + public class SetMaxParticles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The max particles of the ParticleSystem")] + public SharedInt maxParticles; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.maxParticles = maxParticles.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + maxParticles = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs.meta new file mode 100644 index 00000000..8549f671 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetMaxParticles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eadca930ad32a404886060ee43e4d802 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs new file mode 100644 index 00000000..0e3d23db --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the playback speed of the Particle System.")] + public class SetPlaybackSpeed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The playback speed of the ParticleSystem")] + public SharedFloat playbackSpeed = 1; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.simulationSpeed = playbackSpeed.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + playbackSpeed = 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs.meta new file mode 100644 index 00000000..1c0afbdb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetPlaybackSpeed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f4d79e34ac8820458a2813895d3962d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs new file mode 100644 index 00000000..0af7d9bb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start color of the Particle System.")] + public class SetStartColor : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start color of the ParticleSystem")] + public SharedColor startColor; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startColor = startColor.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startColor = Color.white; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs.meta new file mode 100644 index 00000000..12432173 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f91be163d0c01ec42bf120c267dcceea +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs new file mode 100644 index 00000000..f814e540 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start delay of the Particle System.")] + public class SetStartDelay : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start delay of the ParticleSystem")] + public SharedFloat startDelay; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startDelayMultiplier = startDelay.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startDelay = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs.meta new file mode 100644 index 00000000..fb4c01f5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartDelay.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 532026cf3b430c840897e66bdde5006e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs new file mode 100644 index 00000000..0bfec7a7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start lifetime of the Particle System.")] + public class SetStartLifetime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start lifetime of the ParticleSystem")] + public SharedFloat startLifetime; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startLifetimeMultiplier = startLifetime.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startLifetime = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs.meta new file mode 100644 index 00000000..361689aa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartLifetime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 311b9ed850b4e2243ae44487b9ece819 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs new file mode 100644 index 00000000..404acbf3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start rotation of the Particle System.")] + public class SetStartRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start rotation of the ParticleSystem")] + public SharedFloat startRotation; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startRotationMultiplier = startRotation.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startRotation = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs.meta new file mode 100644 index 00000000..c995958e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae611ab09913de6438aeb81d7a621c51 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs new file mode 100644 index 00000000..bb6667e5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start size of the Particle System.")] + public class SetStartSize : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start size of the ParticleSystem")] + public SharedFloat startSize; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startSizeMultiplier = startSize.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startSize = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs.meta new file mode 100644 index 00000000..d697099c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7be6a1da3f4f7a418e5739a6cc6e78e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs new file mode 100644 index 00000000..6e9b155c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the start speed of the Particle System.")] + public class SetStartSpeed : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The start speed of the ParticleSystem")] + public SharedFloat startSpeed; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + ParticleSystem.MainModule main = particleSystem.main; + main.startSpeedMultiplier = startSpeed.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + startSpeed = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs.meta new file mode 100644 index 00000000..f87bf954 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetStartSpeed.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7716318475d3854a96729d1a7540d4a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs new file mode 100644 index 00000000..41f2e9eb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Sets the time of the Particle System.")] + public class SetTime : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The time of the ParticleSystem")] + public SharedFloat time; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.time = time.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs.meta new file mode 100644 index 00000000..2788eb15 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/SetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 103e78e9c755fe3469e63115eb1c0d80 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs new file mode 100644 index 00000000..fcf70cfb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Simulate the Particle System.")] + public class Simulate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Time to fastfoward the Particle System to")] + public SharedFloat time; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.Simulate(time.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + time = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs.meta new file mode 100644 index 00000000..c703cb24 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Simulate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24d79d661acf61e44918320624b49dd5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs new file mode 100644 index 00000000..2ed84c15 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityParticleSystem +{ + [TaskCategory("Basic/ParticleSystem")] + [TaskDescription("Stop the Particle System.")] + public class Stop : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private ParticleSystem particleSystem; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + particleSystem = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (particleSystem == null) { + Debug.LogWarning("ParticleSystem is null"); + return TaskStatus.Failure; + } + + particleSystem.Stop(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs.meta new file mode 100644 index 00000000..695ec19d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/ParticleSystem/Stop.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fd83617024d6bff44824a83b472db8e6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics.meta new file mode 100644 index 00000000..10cd345e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: f029d04458be91f4d9b9bec1c9ccfde7 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs new file mode 100644 index 00000000..fb82128e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics +{ + [TaskCategory("Basic/Physics")] + [TaskDescription("Returns success if there is any collider intersecting the line between start and end")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=117")] + public class Linecast : Action + { + [Tooltip("The starting position of the linecast")] + SharedVector3 startPosition; + [Tooltip("The ending position of the linecast")] + SharedVector3 endPosition; + [Tooltip("Selectively ignore colliders.")] + public LayerMask layerMask = -1; + + public override TaskStatus OnUpdate() + { + return Physics.Linecast(startPosition.Value, endPosition.Value, layerMask) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + startPosition = Vector3.zero; + endPosition = Vector3.zero; + layerMask = -1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs.meta new file mode 100644 index 00000000..c380726f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Linecast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 163f5567b8906cd45adf138c3c022152 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs new file mode 100644 index 00000000..d79c9ae9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs @@ -0,0 +1,71 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics +{ + [TaskCategory("Basic/Physics")] + [TaskDescription("Casts a ray against all colliders in the scene. Returns success if a collider was hit.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=117")] + public class Raycast : Action + { + [Tooltip("Starts the ray at the GameObject's position. If null the originPosition will be used")] + public SharedGameObject originGameObject; + [Tooltip("Starts the ray at the position. Only used if originGameObject is null")] + public SharedVector3 originPosition; + [Tooltip("The direction of the ray")] + public SharedVector3 direction; + [Tooltip("The length of the ray. Set to -1 for infinity")] + public SharedFloat distance = -1; + [Tooltip("Selectively ignore colliders")] + public LayerMask layerMask = -1; + [Tooltip("Cast the ray in world or local space. The direction is in world space if no GameObject is specified")] + public Space space = Space.Self; + + [SharedRequired] + [Tooltip("Stores the hit object of the raycast")] + public SharedGameObject storeHitObject; + [SharedRequired] + [Tooltip("Stores the hit point of the raycast")] + public SharedVector3 storeHitPoint; + [SharedRequired] + [Tooltip("Stores the hit normal of the raycast")] + public SharedVector3 storeHitNormal; + [SharedRequired] + [Tooltip("Stores the hit distance of the raycast")] + public SharedFloat storeHitDistance; + + 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.Value = hit.collider.gameObject; + storeHitPoint.Value = hit.point; + storeHitNormal.Value = hit.normal; + storeHitDistance.Value = hit.distance; + return TaskStatus.Success; + } + + return TaskStatus.Failure; + } + + public override void OnReset() + { + originGameObject = null; + originPosition = Vector3.zero; + direction = Vector3.zero; + distance = -1; + layerMask = -1; + space = Space.Self; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs.meta new file mode 100644 index 00000000..b5f5d6d9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Raycast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afcf9d39edef45146ad7a043b8bfa76e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs new file mode 100644 index 00000000..da1c646e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs @@ -0,0 +1,74 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics +{ + [TaskCategory("Basic/Physics")] + [TaskDescription("Casts a sphere against all colliders in the scene. Returns success if a collider was hit.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=117")] + public class SphereCast : Action + { + [Tooltip("Starts the spherecast at the GameObject's position. If null the originPosition will be used")] + public SharedGameObject originGameObject; + [Tooltip("Starts the sherecast at the position. Only used if originGameObject is null")] + public SharedVector3 originPosition; + [Tooltip("The radius of the spherecast")] + public SharedFloat radius; + [Tooltip("The direction of the spherecast")] + public SharedVector3 direction; + [Tooltip("The length of the spherecast. Set to -1 for infinity")] + public SharedFloat distance = -1; + [Tooltip("Selectively ignore colliders")] + public LayerMask layerMask = -1; + [Tooltip("Use world or local space. The direction is in world space if no GameObject is specified")] + public Space space = Space.Self; + + [SharedRequired] + [Tooltip("Stores the hit object of the spherecast")] + public SharedGameObject storeHitObject; + [SharedRequired] + [Tooltip("Stores the hit point of the spherecast")] + public SharedVector3 storeHitPoint; + [SharedRequired] + [Tooltip("Stores the hit normal of the spherecast")] + public SharedVector3 storeHitNormal; + [SharedRequired] + [Tooltip("Stores the hit distance of the spherecast")] + public SharedFloat storeHitDistance; + + 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.SphereCast(position, radius.Value, dir, out hit, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask)) { + storeHitObject.Value = hit.collider.gameObject; + storeHitPoint.Value = hit.point; + storeHitNormal.Value = hit.normal; + storeHitDistance.Value = hit.distance; + return TaskStatus.Success; + } + + return TaskStatus.Failure; + } + + public override void OnReset() + { + originGameObject = null; + originPosition = Vector3.zero; + radius = 0; + direction = Vector3.zero; + distance = -1; + layerMask = -1; + space = Space.Self; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs.meta new file mode 100644 index 00000000..24ed1701 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics/Spherecast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2058f3f94c5bdf5409f9ff80ea61d44a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D.meta new file mode 100644 index 00000000..df6bb1d3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 056a8d0f58dcb4749949548a468e90c0 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs new file mode 100644 index 00000000..516abc72 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs @@ -0,0 +1,73 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D +{ + [TaskCategory("Basic/Physics2D")] + [TaskDescription("Casts a circle against all colliders in the scene. Returns success if a collider was hit.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")] + public class Circlecast : Action + { + [Tooltip("Starts the circlecast at the GameObject's position. If null the originPosition will be used.")] + public SharedGameObject originGameObject; + [Tooltip("Starts the circlecast at the position. Only used if originGameObject is null.")] + public SharedVector2 originPosition; + [Tooltip("The radius of the circlecast")] + public SharedFloat radius; + [Tooltip("The direction of the circlecast")] + public SharedVector2 direction; + [Tooltip("The length of the ray. Set to -1 for infinity.")] + public SharedFloat distance = -1; + [Tooltip("Selectively ignore colliders.")] + public LayerMask layerMask = -1; + [Tooltip("Use world or local space. The direction is in world space if no GameObject is specified.")] + public Space space = Space.Self; + + [SharedRequired] + [Tooltip("Stores the hit object of the circlecast.")] + public SharedGameObject storeHitObject; + [SharedRequired] + [Tooltip("Stores the hit point of the circlecast.")] + public SharedVector2 storeHitPoint; + [SharedRequired] + [Tooltip("Stores the hit normal of the circlecast.")] + public SharedVector2 storeHitNormal; + [SharedRequired] + [Tooltip("Stores the hit distance of the circlecast.")] + public SharedFloat storeHitDistance; + + public override TaskStatus OnUpdate() + { + Vector2 position; + Vector2 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; + } + + var hit = Physics2D.CircleCast(position, radius.Value, dir, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask); + if (hit.collider != null) { + storeHitObject.Value = hit.collider.gameObject; + storeHitPoint.Value = hit.point; + storeHitNormal.Value = hit.normal; + storeHitDistance.Value = hit.distance; + return TaskStatus.Success; + } + return TaskStatus.Failure; + } + + public override void OnReset() + { + originGameObject = null; + originPosition = Vector2.zero; + direction = Vector2.zero; + radius = 0; + distance = -1; + layerMask = -1; + space = Space.Self; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta new file mode 100644 index 00000000..541b96a0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Circlecast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6989aa8730764ee459a07f88d84302e0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs new file mode 100644 index 00000000..914b6fee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D +{ + [TaskCategory("Basic/Physics2D")] + [TaskDescription("Returns success if there is any collider intersecting the line between start and end")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")] + public class Linecast : Action + { + [Tooltip("The starting position of the linecast.")] + SharedVector2 startPosition; + [Tooltip("The ending position of the linecast.")] + SharedVector2 endPosition; + [Tooltip("Selectively ignore colliders.")] + public LayerMask layerMask = -1; + + public override TaskStatus OnUpdate() + { + return Physics2D.Linecast(startPosition.Value, endPosition.Value, layerMask) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + startPosition = Vector2.zero; + endPosition = Vector2.zero; + layerMask = -1; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta new file mode 100644 index 00000000..6aa9170f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Linecast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a402dbfe872764f49b3a03d7048e866e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs new file mode 100644 index 00000000..2bc51b80 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs @@ -0,0 +1,72 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPhysics2D +{ + [TaskCategory("Basic/Physics2D")] + [TaskDescription("Casts a ray against all colliders in the scene. Returns success if a collider was hit.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=118")] + public class Raycast : Action + { + [Tooltip("Starts the ray at the GameObject's position. If null the originPosition will be used.")] + public SharedGameObject originGameObject; + [Tooltip("Starts the ray at the position. Only used if originGameObject is null.")] + public SharedVector2 originPosition; + [Tooltip("The direction of the ray")] + public SharedVector2 direction; + [Tooltip("The length of the ray. Set to -1 for infinity.")] + public SharedFloat distance = -1; + [Tooltip("Selectively ignore colliders.")] + public LayerMask layerMask = -1; + [Tooltip("Cast the ray in world or local space. The direction is in world space if no GameObject is specified.")] + public Space space = Space.Self; + + [SharedRequired] + [Tooltip("Stores the hit object of the raycast.")] + public SharedGameObject storeHitObject; + [SharedRequired] + [Tooltip("Stores the hit point of the raycast.")] + public SharedVector2 storeHitPoint; + [SharedRequired] + [Tooltip("Stores the hit normal of the raycast.")] + public SharedVector2 storeHitNormal; + [SharedRequired] + [Tooltip("Stores the hit distance of the raycast.")] + public SharedFloat storeHitDistance; + + public override TaskStatus OnUpdate() + { + Vector2 position; + Vector2 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; + } + + var hit = Physics2D.Raycast(position, dir, distance.Value == -1 ? Mathf.Infinity : distance.Value, layerMask); + if (hit.collider != null) { + storeHitObject.Value = hit.collider.gameObject; + storeHitPoint.Value = hit.point; + storeHitNormal.Value = hit.normal; +#if !UNITY_4_3 + storeHitDistance.Value = hit.distance; +#endif + return TaskStatus.Success; + } + return TaskStatus.Failure; + } + + public override void OnReset() + { + originGameObject = null; + originPosition = Vector2.zero; + direction = Vector2.zero; + distance = -1; + layerMask = -1; + space = Space.Self; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta new file mode 100644 index 00000000..f2f98446 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Physics2D/Raycast.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 513dc641bb68bcc4d9c3bdfb1ccc57b6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs.meta new file mode 100644 index 00000000..e3920af1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: ae97053a4ac34f74d8edc5c635b28bda +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs new file mode 100644 index 00000000..0562303f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Deletes all entries from the PlayerPrefs.")] + public class DeleteAll : Action + { + public override TaskStatus OnUpdate() + { + PlayerPrefs.DeleteAll(); + + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta new file mode 100644 index 00000000..707b849e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteAll.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c6d6b2dabc08ac42875cdbe1f86642b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs new file mode 100644 index 00000000..8fc4c352 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Deletes the specified key from the PlayerPrefs.")] + public class DeleteKey : Action + { + [Tooltip("The key to delete")] + public SharedString key; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.DeleteKey(key.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta new file mode 100644 index 00000000..4f322aea --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/DeleteKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed24098bd046f724e90474d47e1677d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs new file mode 100644 index 00000000..839980b5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetFloat : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedFloat defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetFloat(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = 0; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta new file mode 100644 index 00000000..1252e252 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14752e1987d17d546838a32459045c67 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs new file mode 100644 index 00000000..3dca7702 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetInt : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedInt defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetInt(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = 0; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta new file mode 100644 index 00000000..6e1a400d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66c5c9cfd0fb52344875db0cefc5d6f8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs new file mode 100644 index 00000000..a3d98a97 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Stores the value with the specified key from the PlayerPrefs.")] + public class GetString : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The default value")] + public SharedString defaultValue; + [Tooltip("The value retrieved from the PlayerPrefs")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = PlayerPrefs.GetString(key.Value, defaultValue.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + defaultValue = ""; + storeResult = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta new file mode 100644 index 00000000..155d968b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/GetString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 418066da4d19f1742a6435c0ee7aa01b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs new file mode 100644 index 00000000..2983fc05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Retruns success if the specified key exists.")] + public class HasKey : Conditional + { + [Tooltip("The key to check")] + public SharedString key; + + public override TaskStatus OnUpdate() + { + return PlayerPrefs.HasKey(key.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + key = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta new file mode 100644 index 00000000..49883dfe --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/HasKey.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b16fab74ec9f364f911696814716ca2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs new file mode 100644 index 00000000..627fe81a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Saves the PlayerPrefs.")] + public class Save : Action + { + public override TaskStatus OnUpdate() + { + PlayerPrefs.Save(); + + return TaskStatus.Success; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta new file mode 100644 index 00000000..a03bd8c4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/Save.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 898765f1bc90e154e9cab895a814221e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs new file mode 100644 index 00000000..69b578ca --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetFloat : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedFloat value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetFloat(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta new file mode 100644 index 00000000..87a00ef2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88feec854545b9b428ed714fbebe872f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs new file mode 100644 index 00000000..3e41760f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetInt : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedInt value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetInt(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta new file mode 100644 index 00000000..c9920342 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad23859aa9f9e68468891ba9600b9828 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs new file mode 100644 index 00000000..69426c56 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityPlayerPrefs +{ + [TaskCategory("Basic/PlayerPrefs")] + [TaskDescription("Sets the value with the specified key from the PlayerPrefs.")] + public class SetString : Action + { + [Tooltip("The key to store")] + public SharedString key; + [Tooltip("The value to set")] + public SharedString value; + + public override TaskStatus OnUpdate() + { + PlayerPrefs.SetString(key.Value, value.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + key = ""; + value = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta new file mode 100644 index 00000000..bb989dbd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/PlayerPrefs/SetString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 923ae6162a2661e47be9af80a19e48b6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion.meta new file mode 100644 index 00000000..d65bbdb1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: fdfca1ec6223a5644919a38e092a933c +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs new file mode 100644 index 00000000..a6e485ef --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the angle in degrees between two rotations.")] + public class Angle : Action + { + [Tooltip("The first rotation")] + public SharedQuaternion firstRotation; + [Tooltip("The second rotation")] + public SharedQuaternion secondRotation; + [Tooltip("The stored result")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Angle(firstRotation.Value, secondRotation.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + firstRotation = secondRotation = Quaternion.identity; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs.meta new file mode 100644 index 00000000..0aa20992 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Angle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d316a25dcddd6f4a981df05a1eeaf7c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs new file mode 100644 index 00000000..4c6eecf9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the rotation which rotates the specified degrees around the specified axis.")] + public class AngleAxis : Action + { + [Tooltip("The number of degrees")] + public SharedFloat degrees; + [Tooltip("The axis direction")] + public SharedVector3 axis; + [Tooltip("The stored result")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.AngleAxis(degrees.Value, axis.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + degrees = 0; + axis = Vector3.zero; + storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs.meta new file mode 100644 index 00000000..99c4ba7b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/AngleAxis.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82152b844829f8f43ab44f35bf7d786f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs new file mode 100644 index 00000000..d00fa95b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the dot product between two rotations.")] + public class Dot : Action + { + [Tooltip("The first rotation")] + public SharedQuaternion leftRotation; + [Tooltip("The second rotation")] + public SharedQuaternion rightRotation; + [Tooltip("The stored result")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Dot(leftRotation.Value, rightRotation.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + leftRotation = rightRotation = Quaternion.identity; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs.meta new file mode 100644 index 00000000..40a00107 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Dot.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fa9235523569d574aa7d22ce89423eca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs new file mode 100644 index 00000000..e9930832 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the quaternion of a euler vector.")] + public class Euler : Action + { + [Tooltip("The euler vector")] + public SharedVector3 eulerVector; + [Tooltip("The stored quaternion")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Euler(eulerVector.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + eulerVector = Vector3.zero; + storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs.meta new file mode 100644 index 00000000..048cc76c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Euler.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4d275b4450a324409ace385a718d9ee +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs new file mode 100644 index 00000000..5e68b434 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores a rotation which rotates from the first direction to the second.")] + public class FromToRotation : Action + { + [Tooltip("The from rotation")] + public SharedVector3 fromDirection; + [Tooltip("The to rotation")] + public SharedVector3 toDirection; + [Tooltip("The stored result")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.FromToRotation(fromDirection.Value, toDirection.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromDirection = toDirection = Vector3.zero; + storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs.meta new file mode 100644 index 00000000..d5836cfa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/FromToRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56740b2c218d500408dd75c6c15006ec +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs new file mode 100644 index 00000000..5c8c104a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the quaternion identity.")] + public class Identity : Action + { + [Tooltip("The identity")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.identity; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs.meta new file mode 100644 index 00000000..e8968d73 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Identity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f4eefb6e25898904688a422ca79d763c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs new file mode 100644 index 00000000..e0085ded --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the inverse of the specified quaternion.")] + public class Inverse : Action + { + [Tooltip("The target quaternion")] + public SharedQuaternion targetQuaternion; + [Tooltip("The stored quaternion")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Inverse(targetQuaternion.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + targetQuaternion = storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs.meta new file mode 100644 index 00000000..e255f8bf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Inverse.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab8f5048bc0e5ce409bf3408c60bc3eb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs new file mode 100644 index 00000000..faea9019 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Lerps between two quaternions.")] + public class Lerp : Action + { + [Tooltip("The from rotation")] + public SharedQuaternion fromQuaternion; + [Tooltip("The to rotation")] + public SharedQuaternion toQuaternion; + [Tooltip("The amount to lerp")] + public SharedFloat amount; + [Tooltip("The stored result")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Lerp(fromQuaternion.Value, toQuaternion.Value, amount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromQuaternion = toQuaternion = storeResult = Quaternion.identity; + amount = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs.meta new file mode 100644 index 00000000..4711a2b8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Lerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb19d83a245337542a5c0f02593e8dab +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs new file mode 100644 index 00000000..8e8bf5ab --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the quaternion of a forward vector.")] + public class LookRotation : Action + { + [Tooltip("The forward vector")] + public SharedVector3 forwardVector; + [Tooltip("The second Vector3")] + public SharedVector3 secondVector3; + [Tooltip("The stored quaternion")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.LookRotation(forwardVector.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + forwardVector = Vector3.zero; + storeResult = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs.meta new file mode 100644 index 00000000..b58cb08b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/LookRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e006fb91f87854448b9bd6cb1d20b2f1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs new file mode 100644 index 00000000..77975891 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Stores the quaternion after a rotation.")] + public class RotateTowards : Action + { + [Tooltip("The from rotation")] + public SharedQuaternion fromQuaternion; + [Tooltip("The to rotation")] + public SharedQuaternion toQuaternion; + [Tooltip("The maximum degrees delta")] + public SharedFloat maxDeltaDegrees; + [Tooltip("The stored result")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.RotateTowards(fromQuaternion.Value, toQuaternion.Value, maxDeltaDegrees.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromQuaternion = toQuaternion = storeResult = Quaternion.identity; + maxDeltaDegrees = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs.meta new file mode 100644 index 00000000..4a037c77 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/RotateTowards.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5e043a106ab4784aab997fa0e27f972 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs new file mode 100644 index 00000000..88cac7e6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityQuaternion +{ + [TaskCategory("Basic/Quaternion")] + [TaskDescription("Spherically lerp between two quaternions.")] + public class Slerp : Action + { + [Tooltip("The from rotation")] + public SharedQuaternion fromQuaternion; + [Tooltip("The to rotation")] + public SharedQuaternion toQuaternion; + [Tooltip("The amount to lerp")] + public SharedFloat amount; + [Tooltip("The stored result")] + [RequiredField] + public SharedQuaternion storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Quaternion.Slerp(fromQuaternion.Value, toQuaternion.Value, amount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromQuaternion = toQuaternion = storeResult = Quaternion.identity; + amount = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs.meta new file mode 100644 index 00000000..6e1d7577 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Quaternion/Slerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b36eacb0f1a46624193a622ef50979ff +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer.meta new file mode 100644 index 00000000..04b8c14b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: b7bee06bd6fde844784243b656f96db8 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs new file mode 100644 index 00000000..b0e6df91 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRenderer +{ + [TaskCategory("Basic/Renderer")] + [TaskDescription("Returns Success if the Renderer is visible, otherwise Failure.")] + public class IsVisible : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the renderer component + private Renderer renderer; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + renderer = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (renderer == null) { + Debug.LogWarning("Renderer is null"); + return TaskStatus.Failure; + } + + return renderer.isVisible ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs.meta new file mode 100644 index 00000000..da61b0d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/IsVisible.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b6ba7f7e8884c14c9ef4a74b50b0a8e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs new file mode 100644 index 00000000..e6ebbb37 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRenderer +{ + [TaskCategory("Basic/Renderer")] + [TaskDescription("Sets the material on the Renderer.")] + public class SetMaterial : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The material to set")] + public SharedMaterial material; + + // cache the renderer component + private Renderer renderer; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + renderer = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (renderer == null) { + Debug.LogWarning("Renderer is null"); + return TaskStatus.Failure; + } + + renderer.material = material.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + material = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs.meta new file mode 100644 index 00000000..b77ae7d1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Renderer/SetMaterial.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf71e4b9292cad342877356107f76d39 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody.meta new file mode 100644 index 00000000..f6d7626c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: f560fb42f946dcb4a819c0cca91d9c9d +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs new file mode 100644 index 00000000..2d313eb4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs @@ -0,0 +1,57 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a force to the rigidbody that simulates explosion effects. Returns Success.")] + public class AddExplosionForce : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The force of the explosion")] + public SharedFloat explosionForce; + [Tooltip("The position of the explosion")] + public SharedVector3 explosionPosition; + [Tooltip("The radius of the explosion")] + public SharedFloat explosionRadius; + [Tooltip("Applies the force as if it was applied from beneath the object")] + public float upwardsModifier = 0; + [Tooltip("The type of force")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.AddExplosionForce(explosionForce.Value, explosionPosition.Value, explosionRadius.Value, upwardsModifier, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + explosionForce = 0; + explosionPosition = Vector3.zero; + explosionRadius = 0; + upwardsModifier = 0; + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs.meta new file mode 100644 index 00000000..46e4e7f6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddExplosionForce.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccb592e850d4c734995a2a1c3f930b62 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs new file mode 100644 index 00000000..9e7ff1a9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [RequiredComponent(typeof(Rigidbody))] + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a force to the rigidbody. Returns Success.")] + public class AddForce : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of force to apply")] + public SharedVector3 force; + [Tooltip("The type of force")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.AddForce(force.Value, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + if (force != null) { + force.Value = Vector3.zero; + } + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs.meta new file mode 100644 index 00000000..2ff832db --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForce.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5748d4214b99b8c49ba67902a8495a30 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs new file mode 100644 index 00000000..c76f34c1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a force at the specified position to the rigidbody. Returns Success.")] + public class AddForceAtPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of force to apply")] + public SharedVector3 force; + [Tooltip("The position of the force")] + public SharedVector3 position; + [Tooltip("The type of force")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.AddForceAtPosition(force.Value, position.Value, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + force = Vector3.zero; + position = Vector3.zero; + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs.meta new file mode 100644 index 00000000..e299a9ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddForceAtPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3938bcd4e88b45419aa86adee51a2c2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs new file mode 100644 index 00000000..57e1a9d2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a force to the rigidbody relative to its coordinate system. Returns Success.")] + public class AddRelativeForce : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of force to apply")] + public SharedVector3 force; + [Tooltip("The type of force")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.AddRelativeForce(force.Value, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + force = Vector3.zero; + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs.meta new file mode 100644 index 00000000..be56eac2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeForce.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1de05a2b6197b2d4b9da1c36bf382649 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs new file mode 100644 index 00000000..ec901665 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs @@ -0,0 +1,43 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a torque to the rigidbody relative to its coordinate system. Returns Success.")] + public class AddRelativeTorque : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of torque to apply")] + public SharedVector3 torque; + [Tooltip("The type of torque")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + rigidbody.AddRelativeTorque(torque.Value, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + torque = Vector3.zero; + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs.meta new file mode 100644 index 00000000..3bba15eb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddRelativeTorque.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 71136c1193309b24c93d450b5f2e47be +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs new file mode 100644 index 00000000..35282d09 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Applies a torque to the rigidbody. Returns Success.")] + public class AddTorque : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of torque to apply")] + public SharedVector3 torque; + [Tooltip("The type of torque")] + public ForceMode forceMode = ForceMode.Force; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.AddTorque(torque.Value, forceMode); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + torque = Vector3.zero; + forceMode = ForceMode.Force; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs.meta new file mode 100644 index 00000000..4e6e47c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/AddTorque.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88c726c1cb324e6429637f55d36c3d01 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs new file mode 100644 index 00000000..9aed491c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the angular drag of the Rigidbody. Returns Success.")] + public class GetAngularDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular drag of the Rigidbody")] + [RequiredField] + public SharedFloat storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.angularDrag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs.meta new file mode 100644 index 00000000..f82dda03 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5fb34b334a02db64db2d6a2fb2448be5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs new file mode 100644 index 00000000..556f52e1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the angular velocity of the Rigidbody. Returns Success.")] + public class GetAngularVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular velocity of the Rigidbody")] + [RequiredField] + public SharedVector3 storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.angularVelocity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs.meta new file mode 100644 index 00000000..c4f98927 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetAngularVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 492dc3a13d07ed149bcd19d36e2f7ee7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs new file mode 100644 index 00000000..59c7429c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the center of mass of the Rigidbody. Returns Success.")] + public class GetCenterOfMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of mass of the Rigidbody")] + [RequiredField] + public SharedVector3 storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.centerOfMass; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs.meta new file mode 100644 index 00000000..8c175632 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetCenterOfMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b993020e1d60f5242a7e3618501f871e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs new file mode 100644 index 00000000..423e79b0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the drag of the Rigidbody. Returns Success.")] + public class GetDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The drag of the Rigidbody")] + [RequiredField] + public SharedFloat storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.drag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs.meta new file mode 100644 index 00000000..ab90b18b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69bd087f6899c604f82441b108ead2a8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs new file mode 100644 index 00000000..0a26f2c1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the freeze rotation value of the Rigidbody. Returns Success.")] + public class GetFreezeRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The freeze rotation value of the Rigidbody")] + [RequiredField] + public SharedBool storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.freezeRotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs.meta new file mode 100644 index 00000000..dad7aad7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetFreezeRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 889065cfad95df04a802761fcccb8359 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs new file mode 100644 index 00000000..ee981ed7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the is kinematic value of the Rigidbody. Returns Success.")] + public class GetIsKinematic : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The is kinematic value of the Rigidbody")] + [RequiredField] + public SharedBool storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.isKinematic; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs.meta new file mode 100644 index 00000000..0bef7e35 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetIsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a531151d14b8a9640be8d499d9db4538 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs new file mode 100644 index 00000000..62d0138b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the mass of the Rigidbody. Returns Success.")] + public class GetMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mass of the Rigidbody")] + [RequiredField] + public SharedFloat storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.mass; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs.meta new file mode 100644 index 00000000..71b86955 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2638ca749ba5a404f84fd72811b16c81 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs new file mode 100644 index 00000000..84fa411d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs @@ -0,0 +1,51 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the position of the Rigidbody. Returns Success.")] + public class GetPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Can the target GameObject be empty?")] + public SharedBool allowEmptyTarget; + [Tooltip("The position of the Rigidbody")] + [RequiredField] + public SharedVector3 storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + if (!allowEmptyTarget.Value) { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.position; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + allowEmptyTarget = false; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs.meta new file mode 100644 index 00000000..732ae424 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25f9090c180831b4daaa1a24894681ac +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs new file mode 100644 index 00000000..53d4101f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the rotation of the Rigidbody. Returns Success.")] + public class GetRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rotation of the Rigidbody")] + [RequiredField] + public SharedQuaternion storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.rotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs.meta new file mode 100644 index 00000000..539000a1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 937400bc82220b543aa9b3074f17f4d6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs new file mode 100644 index 00000000..dc20ef51 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the use gravity value of the Rigidbody. Returns Success.")] + public class GetUseGravity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The use gravity value of the Rigidbody")] + [RequiredField] + public SharedBool storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.useGravity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs.meta new file mode 100644 index 00000000..ab211284 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetUseGravity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d7358afc7810ca4aa2ae8a2cd4b9e6e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs new file mode 100644 index 00000000..de66c4ad --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the velocity of the Rigidbody. Returns Success.")] + public class GetVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity of the Rigidbody")] + [RequiredField] + public SharedVector3 storeValue; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody.velocity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs.meta new file mode 100644 index 00000000..62f5920f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/GetVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c18365eb6865164ebb5b0057dcc6bb4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs new file mode 100644 index 00000000..1144ea46 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Returns Success if the Rigidbody is kinematic, otherwise Failure.")] + public class IsKinematic : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + return rigidbody.isKinematic ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs.meta new file mode 100644 index 00000000..ec59f524 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30be28b36412643418c2e61640147eac +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs new file mode 100644 index 00000000..1252e643 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Returns Success if the Rigidbody is sleeping, otherwise Failure.")] + public class IsSleeping : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + return rigidbody.IsSleeping() ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs.meta new file mode 100644 index 00000000..c0c0a203 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/IsSleeping.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 37e8153613f519240a11c3f6583d1030 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs new file mode 100644 index 00000000..81ac9191 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Moves the Rigidbody to the specified position. Returns Success.")] + public class MovePosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The new position of the Rigidbody")] + public SharedVector3 position; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.MovePosition(position.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs.meta new file mode 100644 index 00000000..75fc531c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MovePosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87176662744aee049b8af51b01bcb526 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs new file mode 100644 index 00000000..9133cb77 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Rotates the Rigidbody to the specified rotation. Returns Success.")] + public class MoveRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The new rotation of the Rigidbody")] + public SharedQuaternion rotation; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.MoveRotation(rotation.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs.meta new file mode 100644 index 00000000..65a02522 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/MoveRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1ba2e66d5ca98a4ba4020b4eff4da6e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs new file mode 100644 index 00000000..c08194d2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the angular drag of the Rigidbody. Returns Success.")] + public class SetAngularDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular drag of the Rigidbody")] + public SharedFloat angularDrag; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.angularDrag = angularDrag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + angularDrag = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs.meta new file mode 100644 index 00000000..bfa75a99 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2883595af7ee1c649ae45353482beed8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs new file mode 100644 index 00000000..78f35260 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the angular velocity of the Rigidbody. Returns Success.")] + public class SetAngularVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular velocity of the Rigidbody")] + public SharedVector3 angularVelocity; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.angularVelocity = angularVelocity.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + angularVelocity = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs.meta new file mode 100644 index 00000000..1c2b78f9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetAngularVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8652396368a6dad4eb6e1259e680595c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs new file mode 100644 index 00000000..f57cb25a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the center of mass of the Rigidbody. Returns Success.")] + public class SetCenterOfMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of mass of the Rigidbody")] + public SharedVector3 centerOfMass; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.centerOfMass = centerOfMass.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + centerOfMass = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs.meta new file mode 100644 index 00000000..3a229ffb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetCenterOfMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 594f2d37fbfc0d545a0377cf63543f41 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs new file mode 100644 index 00000000..0b174602 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the constraints of the Rigidbody. Returns Success.")] + public class SetConstraints : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The constraints of the Rigidbody")] + public RigidbodyConstraints constraints = RigidbodyConstraints.None; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.constraints = constraints; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + constraints = RigidbodyConstraints.None; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs.meta new file mode 100644 index 00000000..8affb848 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetConstraints.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd098240974b0184ca8c66cb6e450753 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs new file mode 100644 index 00000000..e755cf6e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the drag of the Rigidbody. Returns Success.")] + public class SetDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The drag of the Rigidbody")] + public SharedFloat drag; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.drag = drag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + drag = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs.meta new file mode 100644 index 00000000..370e0d8b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8984a684f33e6644abbb9cfe6c9068d9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs new file mode 100644 index 00000000..9b6342ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the freeze rotation value of the Rigidbody. Returns Success.")] + public class SetFreezeRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The freeze rotation value of the Rigidbody")] + public SharedBool freezeRotation; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.freezeRotation = freezeRotation.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + freezeRotation = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs.meta new file mode 100644 index 00000000..67fd3cac --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetFreezeRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4160755a1f5174546b6ccbabff469187 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs new file mode 100644 index 00000000..49ead821 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the is kinematic value of the Rigidbody. Returns Success.")] + public class SetIsKinematic : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The is kinematic value of the Rigidbody")] + public SharedBool isKinematic; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.isKinematic = isKinematic.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + isKinematic = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs.meta new file mode 100644 index 00000000..78a73857 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetIsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d93194d82815024cadf3f4f842666d0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs new file mode 100644 index 00000000..48c1da8f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the mass of the Rigidbody. Returns Success.")] + public class SetMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mass of the Rigidbody")] + public SharedFloat mass; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.mass = mass.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + mass = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs.meta new file mode 100644 index 00000000..b1ab1a4e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82f7a92bee3553d49bbb1ebabfaffc12 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs new file mode 100644 index 00000000..86b564a5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the position of the Rigidbody. Returns Success.")] + public class SetPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Rigidbody")] + public SharedVector3 position; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.position = position.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs.meta new file mode 100644 index 00000000..62b9cac0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a33b86eb94a87c449e1f3344973cc50 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs new file mode 100644 index 00000000..ffa231a8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Stores the rotation of the Rigidbody. Returns Success.")] + public class SetRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rotation of the Rigidbody")] + public SharedQuaternion rotation; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.rotation = rotation.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs.meta new file mode 100644 index 00000000..cf104f74 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5ac2e84278f4a845ba47d1e4469e869 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs new file mode 100644 index 00000000..a95330a5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the use gravity value of the Rigidbody. Returns Success.")] + public class SetUseGravity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The use gravity value of the Rigidbody")] + public SharedBool isKinematic; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.useGravity = isKinematic.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + isKinematic = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs.meta new file mode 100644 index 00000000..8e3be08a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetUseGravity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 19548f438ad1c684180d41713cbdeb76 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs new file mode 100644 index 00000000..e488ebc5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Sets the velocity of the Rigidbody. Returns Success.")] + public class SetVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity of the Rigidbody")] + public SharedVector3 velocity; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.velocity = velocity.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + velocity = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs.meta new file mode 100644 index 00000000..c1756a01 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/SetVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e3fc3ca798c87644a42b1c930fff3f0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs new file mode 100644 index 00000000..796f7f29 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Forces the Rigidbody to sleep at least one frame. Returns Success.")] + public class Sleep : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.Sleep(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs.meta new file mode 100644 index 00000000..dc6ae392 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/Sleep.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1683ca7168c4ce74db4396c4d3cb65ce +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs new file mode 100644 index 00000000..1cdcb762 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Returns Success if the Rigidbody is using gravity, otherwise Failure.")] + public class UseGravity : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + return rigidbody.useGravity ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs.meta new file mode 100644 index 00000000..446f7f0d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/UseGravity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a0d11b67c4ae058469e7f7b00db7103f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs new file mode 100644 index 00000000..fcb4fe74 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Forces the Rigidbody to wake up. Returns Success.")] + public class WakeUp : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + // cache the rigidbody component + private Rigidbody rigidbody; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody.WakeUp(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs.meta new file mode 100644 index 00000000..d65620b9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody/WakeUp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4314af88b4d86046bdac1f10f6f9a47 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D.meta new file mode 100644 index 00000000..20f1c74d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 842427c186c2e5941b1b02873f6480e3 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs new file mode 100644 index 00000000..bc084e41 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Applies a force to the Rigidbody2D. Returns Success.")] + public class AddForce : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of force to apply")] + public SharedVector2 force; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.AddForce(force.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + force = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs.meta new file mode 100644 index 00000000..3f52d151 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForce.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ea79154ee01cf441a9744c877542a1f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs new file mode 100644 index 00000000..c1a187c6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Applies a force at the specified position to the Rigidbody2D. Returns Success.")] + public class AddForceAtPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of force to apply")] + public SharedVector2 force; + [Tooltip("The position of the force")] + public SharedVector2 position; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.AddForceAtPosition(force.Value, position.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + force = Vector2.zero; + position = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs.meta new file mode 100644 index 00000000..e1edb20c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddForceAtPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd82f0f77306bad46bae7944a5c66664 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs new file mode 100644 index 00000000..9f065e34 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Applies a torque to the Rigidbody2D. Returns Success.")] + public class AddTorque : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The amount of torque to apply")] + public SharedFloat torque; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.AddTorque(torque.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + torque = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs.meta new file mode 100644 index 00000000..d79e4975 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/AddTorque.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc561d806d4518044becff628e148424 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs new file mode 100644 index 00000000..17080d53 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the angular drag of the Rigidbody2D. Returns Success.")] + public class GetAngularDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular drag of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.angularDrag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs.meta new file mode 100644 index 00000000..4aefa782 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10833270578d69041b561c5126bb31f2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs new file mode 100644 index 00000000..17be28db --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the angular velocity of the Rigidbody2D. Returns Success.")] + public class GetAngularVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular velocity of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.angularVelocity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs.meta new file mode 100644 index 00000000..15cae45b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetAngularVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68ac62a9384c11245a850220f1bc72b8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs new file mode 100644 index 00000000..b01bf9a2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the drag of the Rigidbody2D. Returns Success.")] + public class GetDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The drag of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.drag; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs.meta new file mode 100644 index 00000000..872fb557 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e39198e5d65d514185f2816cced7c7b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs new file mode 100644 index 00000000..95a994f3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs @@ -0,0 +1,47 @@ +#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the fixed angle value of the Rigidbody2D. Returns Success.")] + public class GetFixedAngle : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The fixed angle value of the Rigidbody2D")] + [RequiredField] + public SharedBool storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.fixedAngle; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs.meta new file mode 100644 index 00000000..c33cff34 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetFixedAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eea4c9e433bd63540abef9f91e4c57fb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs new file mode 100644 index 00000000..9b1ef3a0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the gravity scale of the Rigidbody2D. Returns Success.")] + public class GetGravityScale : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The gravity scale of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.gravityScale; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs.meta new file mode 100644 index 00000000..ee205b51 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetGravtyScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e2d17fb9baea6554082f2edc46483e8c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs new file mode 100644 index 00000000..94221a04 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the is kinematic value of the Rigidbody2D. Returns Success.")] + public class GetIsKinematic : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The is kinematic value of the Rigidbody2D")] + [RequiredField] + public SharedBool storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.isKinematic; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs.meta new file mode 100644 index 00000000..10f9161a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetIsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66c6175d42bd49e48be458378e0a7875 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs new file mode 100644 index 00000000..245f2b9e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the mass of the Rigidbody2D. Returns Success.")] + public class GetMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mass of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.mass; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs.meta new file mode 100644 index 00000000..d9588541 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72d52ef5efe5e974994c91279536555e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs new file mode 100644 index 00000000..6b1c1c53 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs @@ -0,0 +1,50 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the position of the Rigidbody2D. Returns Success.")] + public class GetPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Can the target GameObject be empty?")] + public SharedBool allowEmptyTarget; + [Tooltip("The velocity of the Rigidbody2D")] + [RequiredField] + public SharedVector2 storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + if (!allowEmptyTarget.Value) { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.position; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + allowEmptyTarget = false; + storeValue = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs.meta new file mode 100644 index 00000000..00083e0e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 98dff23734f3a834cbf5ccf87c9904f7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs new file mode 100644 index 00000000..061646e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the rotation of the Rigidbody2D. Returns Success.")] + public class GetRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rotation of the Rigidbody2D")] + [RequiredField] + public SharedFloat storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.rotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs.meta new file mode 100644 index 00000000..6be4219c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7d82ab7ef780f34cb5df06366b0bdbf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs new file mode 100644 index 00000000..bbba8a51 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Stores the velocity of the Rigidbody2D. Returns Success.")] + public class GetVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity of the Rigidbody2D")] + [RequiredField] + public SharedVector2 storeValue; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + storeValue.Value = rigidbody2D.velocity; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs.meta new file mode 100644 index 00000000..d92cc9fd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/GetVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 13009f7b6ee1bc04884442484a065cc3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs new file mode 100644 index 00000000..9bccbaef --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Returns Success if the Rigidbody2D is kinematic, otherwise Failure.")] + public class IsKinematic : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + return rigidbody2D.isKinematic ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs.meta new file mode 100644 index 00000000..edf168f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47d2e6e60a2251c41a2c548dc9a8c922 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs new file mode 100644 index 00000000..d010d1cc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Returns Success if the Rigidbody2D is sleeping, otherwise Failure.")] + public class IsSleeping : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + return rigidbody2D.IsSleeping() ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs.meta new file mode 100644 index 00000000..3b38a447 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/IsSleeping.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52859810158277a4a917e70a834a82a5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs new file mode 100644 index 00000000..56623639 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Moves the Rigidbody to the specified position. Returns Success.")] + public class MovePosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The new position of the Rigidbody")] + public SharedVector2 position; + + // cache the rigidbody component + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody2D.MovePosition(position.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs.meta new file mode 100644 index 00000000..79762af7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MovePosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e72fab171287194ea2d8eb2aa239cd4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs new file mode 100644 index 00000000..c8e58e3d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody")] + [TaskDescription("Rotates the Rigidbody to the specified rotation. Returns Success.")] + public class MoveRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The new rotation of the Rigidbody")] + public SharedFloat rotation; + + // cache the rigidbody component + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody is null"); + return TaskStatus.Failure; + } + + rigidbody2D.MoveRotation(rotation.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rotation = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs.meta new file mode 100644 index 00000000..09bb16a9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/MoveRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 38b0095c420511f4b9ed263b1b5c6054 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs new file mode 100644 index 00000000..3bb17e07 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the angular drag of the Rigidbody2D. Returns Success.")] + public class SetAngularDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular drag of the Rigidbody2D")] + public SharedFloat angularDrag; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.angularDrag = angularDrag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + angularDrag = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs.meta new file mode 100644 index 00000000..1ec92fe3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1717a737318274e4caa244f86c908851 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs new file mode 100644 index 00000000..9fc45f3d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the angular velocity of the Rigidbody2D. Returns Success.")] + public class SetAngularVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The angular velocity of the Rigidbody2D")] + public SharedFloat angularVelocity; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.angularVelocity = angularVelocity.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + angularVelocity = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs.meta new file mode 100644 index 00000000..a559685e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetAngularVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c73dfb332d90cbe4280c21fafa59e2fa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs new file mode 100644 index 00000000..1530cc07 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the drag of the Rigidbody2D. Returns Success.")] + public class SetDrag : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The drag of the Rigidbody2D")] + public SharedFloat drag; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.drag = drag.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + drag = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs.meta new file mode 100644 index 00000000..96d06ce2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetDrag.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3148efd94c23d634a9f02cc9c808de80 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs new file mode 100644 index 00000000..fdd75d2e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs @@ -0,0 +1,46 @@ +#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the fixed angle value of the Rigidbody2D. Returns Success.")] + public class SetFixedAngle : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The fixed angle value of the Rigidbody2D")] + public SharedBool fixedAngle; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.fixedAngle = fixedAngle.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + fixedAngle = false; + } + } +} +#endif \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs.meta new file mode 100644 index 00000000..5a97e4fc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetFixedAngle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0bc5b6a279943ff459ed27083e6bdbb0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs new file mode 100644 index 00000000..a6ce28a4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the gravity scale of the Rigidbody2D. Returns Success.")] + public class SetGravityScale : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The gravity scale of the Rigidbody2D")] + public SharedFloat gravityScale; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.gravityScale = gravityScale.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + gravityScale = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs.meta new file mode 100644 index 00000000..516e6ac5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetGravityScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac896135858701649bcaffc7ef00637f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs new file mode 100644 index 00000000..c8e2563e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the is kinematic value of the Rigidbody2D. Returns Success.")] + public class SetIsKinematic : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The is kinematic value of the Rigidbody2D")] + public SharedBool isKinematic; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.isKinematic = isKinematic.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + isKinematic = false; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs.meta new file mode 100644 index 00000000..ff7f5f2c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetIsKinematic.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7c96d64d821e304a8c67c031565d902 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs new file mode 100644 index 00000000..c218e087 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the mass of the Rigidbody2D. Returns Success.")] + public class SetMass : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The mass of the Rigidbody2D")] + public SharedFloat mass; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.mass = mass.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + mass = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs.meta new file mode 100644 index 00000000..042c36e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetMass.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: facbfd14ece02214889d587f06215105 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs new file mode 100644 index 00000000..7f1f782a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Sets the velocity of the Rigidbody2D. Returns Success.")] + public class SetVelocity : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The velocity of the Rigidbody2D")] + public SharedVector2 velocity; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.velocity = velocity.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + velocity = Vector2.zero; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs.meta new file mode 100644 index 00000000..a78bc24c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/SetVelocity.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5830960da4f9a3148ba5d8cd87228748 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs new file mode 100644 index 00000000..9357826c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Forces the Rigidbody2D to sleep at least one frame. Returns Success.")] + public class Sleep : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.Sleep(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs.meta new file mode 100644 index 00000000..9e50b4e1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/Sleep.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e24fd00ca72fda48a132dc9bfa71070 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs new file mode 100644 index 00000000..66a3318d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityRigidbody2D +{ + [TaskCategory("Basic/Rigidbody2D")] + [TaskDescription("Forces the Rigidbody2D to wake up. Returns Success.")] + public class WakeUp : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + + private Rigidbody2D rigidbody2D; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + rigidbody2D = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (rigidbody2D == null) { + Debug.LogWarning("Rigidbody2D is null"); + return TaskStatus.Failure; + } + + rigidbody2D.WakeUp(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs.meta new file mode 100644 index 00000000..ce6821bb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Rigidbody2D/WakeUp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 954f1f9c196c39345b2fd389516ad613 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables.meta new file mode 100644 index 00000000..aee942b4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 1ca8022ad636ccc4ab940c05d58dfd6b +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs new file mode 100644 index 00000000..a1695f2e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedBool : Conditional + { + [Tooltip("The first variable to compare")] + public SharedBool variable; + [Tooltip("The variable to compare to")] + public SharedBool compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = false; + compareTo = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs.meta new file mode 100644 index 00000000..1e856966 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba0766a97c2e5c94fbc49d8cb1dea8e3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs new file mode 100644 index 00000000..58e23442 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedColor : Conditional + { + [Tooltip("The first variable to compare")] + public SharedColor variable; + [Tooltip("The variable to compare to")] + public SharedColor compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = Color.black; + compareTo = Color.black; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs.meta new file mode 100644 index 00000000..2a8f288a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9e83747d98bd064b9a5ad62b36d7657 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs new file mode 100644 index 00000000..a2434fe0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedFloat : Conditional + { + [Tooltip("The first variable to compare")] + public SharedFloat variable; + [Tooltip("The variable to compare to")] + public SharedFloat compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = 0; + compareTo = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs.meta new file mode 100644 index 00000000..42430338 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6925a99e92b6d804db1f4b607e7501d3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs new file mode 100644 index 00000000..fda37a7e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedGameObject : Conditional + { + [Tooltip("The first variable to compare")] + public SharedGameObject variable; + [Tooltip("The variable to compare to")] + public SharedGameObject compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs.meta new file mode 100644 index 00000000..b0e3b516 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: daa5c3b8a325bcd4bb3da10a6715f6d0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs new file mode 100644 index 00000000..b483e9a1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using System.Linq; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedGameObjectList : Conditional + { + [Tooltip("The first variable to compare")] + public SharedGameObjectList variable; + [Tooltip("The variable to compare to")] + public SharedGameObjectList compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + if (variable.Value.Count != compareTo.Value.Count) + return TaskStatus.Failure; + + return variable.Value.Except(compareTo.Value).Count() > 0 ? TaskStatus.Failure : TaskStatus.Success; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs.meta new file mode 100644 index 00000000..6db560f6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedGameObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2b81932d36a0be4fba0868f7ed3e53c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs new file mode 100644 index 00000000..65841a88 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedInt : Conditional + { + [Tooltip("The first variable to compare")] + public SharedInt variable; + [Tooltip("The variable to compare to")] + public SharedInt compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = 0; + compareTo = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs.meta new file mode 100644 index 00000000..0ea01290 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40307a4117777b4479a1402fd67811ff +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs new file mode 100644 index 00000000..b53daf88 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedObject : Conditional + { + [Tooltip("The first variable to compare")] + public SharedObject variable; + [Tooltip("The variable to compare to")] + public SharedObject compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs.meta new file mode 100644 index 00000000..08e55c50 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66a9105498519ae4082d9ac7adcf5da4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs new file mode 100644 index 00000000..aa3bdd2c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using System.Linq; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedObjectList : Conditional + { + [Tooltip("The first variable to compare")] + public SharedObjectList variable; + [Tooltip("The variable to compare to")] + public SharedObjectList compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + if (variable.Value.Count != compareTo.Value.Count) + return TaskStatus.Failure; + + return variable.Value.Except(compareTo.Value).Count() > 0 ? TaskStatus.Failure : TaskStatus.Success; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs.meta new file mode 100644 index 00000000..0183b3f4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac4cab9acc737904885d379388e83950 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs new file mode 100644 index 00000000..9a17ec10 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedQuaternion : Conditional + { + [Tooltip("The first variable to compare")] + public SharedQuaternion variable; + [Tooltip("The variable to compare to")] + public SharedQuaternion compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = Quaternion.identity; + compareTo = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs.meta new file mode 100644 index 00000000..a5b7ad50 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedQuaternion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 101b2ac215bf58149ab91be3b55d5145 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs new file mode 100644 index 00000000..ccbe413b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedRect : Conditional + { + [Tooltip("The first variable to compare")] + public SharedRect variable; + [Tooltip("The variable to compare to")] + public SharedRect compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = new Rect(); + compareTo = new Rect(); + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs.meta new file mode 100644 index 00000000..975e83ed --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedRect.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d73d97622bbe61d4c91f9b4cacb3e0c2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs new file mode 100644 index 00000000..9d9bd961 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedString : Conditional + { + [Tooltip("The first variable to compare")] + public SharedString variable; + [Tooltip("The variable to compare to")] + public SharedString compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = ""; + compareTo = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs.meta new file mode 100644 index 00000000..19000027 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b1a3248c84732345914404e47a55fcc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs new file mode 100644 index 00000000..34c35cf2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedTransform : Conditional + { + [Tooltip("The first variable to compare")] + public SharedTransform variable; + [Tooltip("The variable to compare to")] + public SharedTransform compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs.meta new file mode 100644 index 00000000..ecaf052e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransform.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a21f70566ff2afc4e95454d3d658c1fa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs new file mode 100644 index 00000000..b245b344 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using System.Linq; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedTransformList : Conditional + { + [Tooltip("The first variable to compare")] + public SharedTransformList variable; + [Tooltip("The variable to compare to")] + public SharedTransformList compareTo; + + public override TaskStatus OnUpdate() + { + if (variable.Value == null && compareTo.Value != null) + return TaskStatus.Failure; + if (variable.Value == null && compareTo.Value == null) + return TaskStatus.Success; + if (variable.Value.Count != compareTo.Value.Count) + return TaskStatus.Failure; + + return variable.Value.Except(compareTo.Value).Count() > 0 ? TaskStatus.Failure : TaskStatus.Success; + } + + public override void OnReset() + { + variable = null; + compareTo = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs.meta new file mode 100644 index 00000000..fb7a667a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedTransformList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ea22243f4fc22946a0033142f3a2380 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs new file mode 100644 index 00000000..c419b558 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedVector2 : Conditional + { + [Tooltip("The first variable to compare")] + public SharedVector2 variable; + [Tooltip("The variable to compare to")] + public SharedVector2 compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = Vector2.zero; + compareTo = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs.meta new file mode 100644 index 00000000..1952f213 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector2.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce90fa6ac7a64b044936fa647e5f0e80 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs new file mode 100644 index 00000000..03c89378 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedVector3 : Conditional + { + [Tooltip("The first variable to compare")] + public SharedVector3 variable; + [Tooltip("The variable to compare to")] + public SharedVector3 compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = Vector3.zero; + compareTo = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs.meta new file mode 100644 index 00000000..b9ea65fc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector3.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 617192db87511d844940d400c960d13d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs new file mode 100644 index 00000000..e502fe99 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Returns success if the variable value is equal to the compareTo value.")] + public class CompareSharedVector4 : Conditional + { + [Tooltip("The first variable to compare")] + public SharedVector4 variable; + [Tooltip("The variable to compare to")] + public SharedVector4 compareTo; + + public override TaskStatus OnUpdate() + { + return variable.Value.Equals(compareTo.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + variable = Vector4.zero; + compareTo = Vector4.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs.meta new file mode 100644 index 00000000..119336b2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/CompareSharedVector4.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9738be23ad39d2c4ba8adc018b545ece +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs new file mode 100644 index 00000000..4f5566ac --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedBool variable to the specified object. Returns Success.")] + public class SetSharedBool : Action + { + [Tooltip("The value to set the SharedBool to")] + public SharedBool targetValue; + [RequiredField] + [Tooltip("The SharedBool to set")] + public SharedBool targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = false; + targetVariable = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs.meta new file mode 100644 index 00000000..251b180c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54f63c79d78692a4e84e502f7cd705a6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs new file mode 100644 index 00000000..120bdb1a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedColor variable to the specified object. Returns Success.")] + public class SetSharedColor : Action + { + [Tooltip("The value to set the SharedColor to")] + public SharedColor targetValue; + [RequiredField] + [Tooltip("The SharedColor to set")] + public SharedColor targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = Color.black; + targetVariable = Color.black; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs.meta new file mode 100644 index 00000000..7132dddb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 48c49264be0e7244ba46b8c970027a20 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs new file mode 100644 index 00000000..49ed89a4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedFloat variable to the specified object. Returns Success.")] + public class SetSharedFloat : Action + { + [Tooltip("The value to set the SharedFloat to")] + public SharedFloat targetValue; + [RequiredField] + [Tooltip("The SharedFloat to set")] + public SharedFloat targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = 0; + targetVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs.meta new file mode 100644 index 00000000..5f1588ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d5b15c88fb154446b9b1ad90cb3987f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs new file mode 100644 index 00000000..7db27528 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedGameObject variable to the specified object. Returns Success.")] + public class SetSharedGameObject : Action + { + [Tooltip("The value to set the SharedGameObject to. If null the variable will be set to the current GameObject")] + public SharedGameObject targetValue; + [RequiredField] + [Tooltip("The SharedGameObject to set")] + public SharedGameObject targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = (targetValue.Value != null ? targetValue.Value : gameObject); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs.meta new file mode 100644 index 00000000..859f7776 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf4af224a0ebd5946bc4f01f18d0627b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs new file mode 100644 index 00000000..d9633d7c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedGameObjectList variable to the specified object. Returns Success.")] + public class SetSharedGameObjectList : Action + { + [Tooltip("The value to set the SharedGameObjectList to.")] + public SharedGameObjectList targetValue; + [RequiredField] + [Tooltip("The SharedGameObjectList to set")] + public SharedGameObjectList targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs.meta new file mode 100644 index 00000000..f5b14ddc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedGameObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b02b163c1dc1b894ca53f80378e39b26 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs new file mode 100644 index 00000000..712bf26e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedInt variable to the specified object. Returns Success.")] + public class SetSharedInt : Action + { + [Tooltip("The value to set the SharedInt to")] + public SharedInt targetValue; + [RequiredField] + [Tooltip("The SharedInt to set")] + public SharedInt targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = 0; + targetVariable = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs.meta new file mode 100644 index 00000000..279e8dba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 742d2b1426f291e45b03bcf845c53a67 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs new file mode 100644 index 00000000..19bf9a50 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedObject variable to the specified object. Returns Success.")] + public class SetSharedObject : Action + { + [Tooltip("The value to set the SharedObject to")] + public SharedObject targetValue; + [RequiredField] + [Tooltip("The SharedTransform to set")] + public SharedObject targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs.meta new file mode 100644 index 00000000..f779b22c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f80da138a03cfdd4e98af96ed5f6681b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs new file mode 100644 index 00000000..d74ffa45 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedObjectList variable to the specified object. Returns Success.")] + public class SetSharedObjectList : Action + { + [Tooltip("The value to set the SharedObjectList to.")] + public SharedObjectList targetValue; + [RequiredField] + [Tooltip("The SharedObjectList to set")] + public SharedObjectList targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs.meta new file mode 100644 index 00000000..0a74168d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b5c211b64a2cf364e99b99dab3ce3c87 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs new file mode 100644 index 00000000..7f4e95da --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs @@ -0,0 +1,27 @@ +using UnityEngine; +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedQuaternion variable to the specified object. Returns Success.")] + public class SetSharedQuaternion : Action + { + [Tooltip("The value to set the SharedQuaternion to")] + public SharedQuaternion targetValue; + [RequiredField] + [Tooltip("The SharedQuaternion to set")] + public SharedQuaternion targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = Quaternion.identity; + targetVariable = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs.meta new file mode 100644 index 00000000..c5975461 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedQuaternion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42f84705fc5571e4088098d1239b5f46 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs new file mode 100644 index 00000000..bcef0665 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedRect variable to the specified object. Returns Success.")] + public class SetSharedRect : Action + { + [Tooltip("The value to set the SharedRect to")] + public SharedRect targetValue; + [RequiredField] + [Tooltip("The SharedRect to set")] + public SharedRect targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = new Rect(); + targetVariable = new Rect(); + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs.meta new file mode 100644 index 00000000..97568cdc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedRect.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7313c7640a9d92b4294a7702b3c5339b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs new file mode 100644 index 00000000..b824735f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedString variable to the specified object. Returns Success.")] + public class SetSharedString : Action + { + [Tooltip("The value to set the SharedString to")] + public SharedString targetValue; + [RequiredField] + [Tooltip("The SharedString to set")] + public SharedString targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = ""; + targetVariable = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs.meta new file mode 100644 index 00000000..c36a773e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 92060068b2f07c54f930e1b8a8976c11 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs new file mode 100644 index 00000000..e1f46c80 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedTransform variable to the specified object. Returns Success.")] + public class SetSharedTransform : Action + { + [Tooltip("The value to set the SharedTransform to. If null the variable will be set to the current Transform")] + public SharedTransform targetValue; + [RequiredField] + [Tooltip("The SharedTransform to set")] + public SharedTransform targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = (targetValue.Value != null ? targetValue.Value : transform); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs.meta new file mode 100644 index 00000000..dee1b887 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransform.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 78e7da45e8b6c2e4cbbf4fdf474070e5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs new file mode 100644 index 00000000..382de932 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedTransformList variable to the specified object. Returns Success.")] + public class SetSharedTransformList : Action + { + [Tooltip("The value to set the SharedTransformList to.")] + public SharedTransformList targetValue; + [RequiredField] + [Tooltip("The SharedTransformList to set")] + public SharedTransformList targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = null; + targetVariable = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs.meta new file mode 100644 index 00000000..11b0bb2a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedTransformList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fae9cd59e50283949a2cc8ec460ffafe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs new file mode 100644 index 00000000..6c086a23 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedVector2 variable to the specified object. Returns Success.")] + public class SetSharedVector2 : Action + { + [Tooltip("The value to set the SharedVector2 to")] + public SharedVector2 targetValue; + [RequiredField] + [Tooltip("The SharedVector2 to set")] + public SharedVector2 targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = Vector2.zero; + targetVariable = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs.meta new file mode 100644 index 00000000..b9b672f9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector2.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c70cf248c723950409d74c11d0781c06 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs new file mode 100644 index 00000000..ef2ae959 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedVector3 variable to the specified object. Returns Success.")] + public class SetSharedVector3 : Action + { + [Tooltip("The value to set the SharedVector3 to")] + public SharedVector3 targetValue; + [RequiredField] + [Tooltip("The SharedVector3 to set")] + public SharedVector3 targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = Vector3.zero; + targetVariable = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs.meta new file mode 100644 index 00000000..6b80394d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector3.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 281820e8b30038d48b4fa8f25728e6c3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs new file mode 100644 index 00000000..a9a97753 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedVector4 variable to the specified object. Returns Success.")] + public class SetSharedVector4 : Action + { + [Tooltip("The value to set the SharedVector4 to")] + public SharedVector4 targetValue; + [RequiredField] + [Tooltip("The SharedVector4 to set")] + public SharedVector4 targetVariable; + + public override TaskStatus OnUpdate() + { + targetVariable.Value = targetValue.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetValue = Vector4.zero; + targetVariable = Vector4.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs.meta new file mode 100644 index 00000000..501d083c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SetSharedVector4.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ca30d99da0685a4fa32d79624a5c0a0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs new file mode 100644 index 00000000..e24d8835 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs @@ -0,0 +1,32 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Gets the Transform from the GameObject. Returns Success.")] + public class SharedGameObjectToTransform : Action + { + [Tooltip("The GameObject to get the Transform of")] + public SharedGameObject sharedGameObject; + [RequiredField] + [Tooltip("The Transform to set")] + public SharedTransform sharedTransform; + + public override TaskStatus OnUpdate() + { + if (sharedGameObject.Value == null) { + return TaskStatus.Failure; + } + + sharedTransform.Value = sharedGameObject.Value.GetComponent(); + + return TaskStatus.Success; + } + + public override void OnReset() + { + sharedGameObject = null; + sharedTransform = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs.meta new file mode 100644 index 00000000..58b9caa8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectToTransform.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c08dcd1e915bef6448649ffe4d3bef3d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs new file mode 100644 index 00000000..5849ac45 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedGameObjectList values from the GameObjects. Returns Success.")] + public class SharedGameObjectsToGameObjectList : Action + { + [Tooltip("The GameObjects value")] + public SharedGameObject[] gameObjects; + [RequiredField] + [Tooltip("The SharedTransformList to set")] + public SharedGameObjectList storedGameObjectList; + + public override void OnAwake() + { + storedGameObjectList.Value = new List(); + } + + public override TaskStatus OnUpdate() + { + if (gameObjects == null || gameObjects.Length == 0) { + return TaskStatus.Failure; + } + + storedGameObjectList.Value.Clear(); + for (int i = 0; i < gameObjects.Length; ++i) { + storedGameObjectList.Value.Add(gameObjects[i].Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + gameObjects = null; + storedGameObjectList = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs.meta new file mode 100644 index 00000000..4d5c325a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedGameObjectsToGameObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4460871f1a9671343896ef9e56d9ceab +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs new file mode 100644 index 00000000..bc8d10ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs @@ -0,0 +1,32 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Gets the GameObject from the Transform component. Returns Success.")] + public class SharedTransformToGameObject : Action + { + [Tooltip("The Transform component")] + public SharedTransform sharedTransform; + [RequiredField] + [Tooltip("The GameObject to set")] + public SharedGameObject sharedGameObject; + + public override TaskStatus OnUpdate() + { + if (sharedTransform.Value == null) { + return TaskStatus.Failure; + } + + sharedGameObject.Value = sharedTransform.Value.gameObject; + + return TaskStatus.Success; + } + + public override void OnReset() + { + sharedTransform = null; + sharedGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs.meta new file mode 100644 index 00000000..a5bb06c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformToGameObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2fd208ea1a8e1642a32148186f9e077 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs new file mode 100644 index 00000000..06ed2690 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs @@ -0,0 +1,41 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.SharedVariables +{ + [TaskCategory("Basic/SharedVariable")] + [TaskDescription("Sets the SharedTransformList values from the Transforms. Returns Success.")] + public class SharedTransformsToTransformList : Action + { + [Tooltip("The Transforms value")] + public SharedTransform[] transforms; + [RequiredField] + [Tooltip("The SharedTransformList to set")] + public SharedTransformList storedTransformList; + + public override void OnAwake() + { + storedTransformList.Value = new List(); + } + + public override TaskStatus OnUpdate() + { + if (transforms == null || transforms.Length == 0) { + return TaskStatus.Failure; + } + + storedTransformList.Value.Clear(); + for (int i = 0; i < transforms.Length; ++i) { + storedTransformList.Value.Add(transforms[i].Value); + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + transforms = null; + storedTransformList = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs.meta new file mode 100644 index 00000000..5aa0a81e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SharedVariables/SharedTransformsToTransformList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3533c6733499e9446b1eae98c8fcaeea +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider.meta new file mode 100644 index 00000000..da065ece --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 79bf48a44f2371244a34ff82aaeaaded +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs new file mode 100644 index 00000000..84793c5b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnitySphereCollider +{ + [TaskCategory("Basic/SphereCollider")] + [TaskDescription("Stores the center of the SphereCollider. Returns Success.")] + public class GetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the SphereCollider")] + [RequiredField] + public SharedVector3 storeValue; + + private SphereCollider sphereCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + sphereCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (sphereCollider == null) { + Debug.LogWarning("SphereCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = sphereCollider.center; + + return TaskStatus.Success; + } + + public override void OnReset() + { + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs.meta new file mode 100644 index 00000000..19d5324a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d95a2896b550c5b4382b7ed35860f504 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs new file mode 100644 index 00000000..81531b9e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnitySphereCollider +{ + [TaskCategory("Basic/SphereCollider")] + [TaskDescription("Stores the radius of the SphereCollider. Returns Success.")] + public class GetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the SphereCollider")] + [RequiredField] + public SharedFloat storeValue; + + private SphereCollider sphereCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + sphereCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (sphereCollider == null) { + Debug.LogWarning("SphereCollider is null"); + return TaskStatus.Failure; + } + + storeValue.Value = sphereCollider.radius; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs.meta new file mode 100644 index 00000000..483f418a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/GetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ff93bf538eee1444b3c51aadfc9bb7f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs new file mode 100644 index 00000000..068800e1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnitySphereCollider +{ + [TaskCategory("Basic/SphereCollider")] + [TaskDescription("Sets the center of the SphereCollider. Returns Success.")] + public class SetCenter : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The center of the SphereCollider")] + public SharedVector3 center; + + private SphereCollider sphereCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + sphereCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (sphereCollider == null) { + Debug.LogWarning("SphereCollider is null"); + return TaskStatus.Failure; + } + + sphereCollider.center = center.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + center = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs.meta new file mode 100644 index 00000000..a9af8a3a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetCenter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dffebfe905e60814ab75e0d7c57432ec +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs new file mode 100644 index 00000000..483bae53 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnitySphereCollider +{ + [TaskCategory("Basic/SphereCollider")] + [TaskDescription("Sets the radius of the SphereCollider. Returns Success.")] + public class SetRadius : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The radius of the SphereCollider")] + public SharedFloat radius; + + private SphereCollider sphereCollider; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + sphereCollider = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (sphereCollider == null) { + Debug.LogWarning("SphereCollider is null"); + return TaskStatus.Failure; + } + + sphereCollider.radius = radius.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + radius = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs.meta new file mode 100644 index 00000000..c1855dd0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/SphereCollider/SetRadius.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5f45a94e6b603f2498481f61218b1769 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String.meta new file mode 100644 index 00000000..7456253a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: f1fb420b7a56bfa4ebafed6237009045 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs new file mode 100644 index 00000000..cf8e430f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs @@ -0,0 +1,31 @@ +using UnityEngine; +using System; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Creates a string from multiple other strings.")] + public class BuildString : Action + { + [Tooltip("The array of strings")] + public SharedString[] source; + [Tooltip("The stored result")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + for (int i = 0; i < source.Length; ++i) { + storeResult.Value += source[i]; + } + + return TaskStatus.Success; + } + + public override void OnReset() + { + source = null; + storeResult = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs.meta new file mode 100644 index 00000000..771073df --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/BuildString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9373af75c434e1a4784c2a165ad3ce3b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs new file mode 100644 index 00000000..cb337705 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Compares the first string to the second string. Returns an int which indicates whether the first string precedes, matches, or follows the second string.")] + public class CompareTo : Action + { + [Tooltip("The string to compare")] + public SharedString firstString; + [Tooltip("The string to compare to")] + public SharedString secondString; + [Tooltip("The stored result")] + [RequiredField] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = firstString.Value.CompareTo(secondString.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + firstString = ""; + secondString = ""; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs.meta new file mode 100644 index 00000000..5c5500d2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/CompareTo.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c752378530d87cb4c98ba15e55936abf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs new file mode 100644 index 00000000..96e57f85 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs @@ -0,0 +1,47 @@ +using UnityEngine; +using System; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Stores a string with the specified format.")] + public class Format : Action + { + [Tooltip("The format of the string")] + public SharedString format; + [Tooltip("Any variables to appear in the string")] + public SharedGenericVariable[] variables; + [Tooltip("The result of the format")] + [RequiredField] + public SharedString storeResult; + + private object[] variableValues; + + public override void OnAwake() + { + variableValues = new object[variables.Length]; + } + + public override TaskStatus OnUpdate() + { + for (int i = 0; i < variableValues.Length; ++i) { + variableValues[i] = variables[i].Value.value.GetValue(); + } + + try { + storeResult.Value = string.Format(format.Value, variableValues); + } catch (Exception e) { + Debug.LogError(e.Message); + return TaskStatus.Failure; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + format = ""; + variables = null; + storeResult = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs.meta new file mode 100644 index 00000000..4ddacf96 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Format.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d96c5da37483da346b96ef02fde824cb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs new file mode 100644 index 00000000..5c41ff2b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Stores the length of the string")] + public class GetLength : Action + { + [Tooltip("The target string")] + public SharedString targetString; + [Tooltip("The stored result")] + [RequiredField] + public SharedInt storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = targetString.Value.Length; + return TaskStatus.Success; + } + + public override void OnReset() + { + targetString = ""; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs.meta new file mode 100644 index 00000000..61249d21 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetLength.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ab3e7e038a50c14f9fa0b019399f3be +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs new file mode 100644 index 00000000..9d64210d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Randomly selects a string from the array of strings.")] + public class GetRandomString : Action + { + [Tooltip("The array of strings")] + public SharedString[] source; + [Tooltip("The stored result")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = source[Random.Range(0, source.Length)].Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + source = null; + storeResult = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs.meta new file mode 100644 index 00000000..b2ddfee1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetRandomString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 355abdec2d73d2545b16d5e0d5f4c589 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs new file mode 100644 index 00000000..be5de33e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs @@ -0,0 +1,37 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Stores a substring of the target string")] + public class GetSubstring : Action + { + [Tooltip("The target string")] + public SharedString targetString; + [Tooltip("The start substring index")] + public SharedInt startIndex = 0; + [Tooltip("The length of the substring. Don't use if -1")] + public SharedInt length = -1; + [Tooltip("The stored result")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + if (length.Value != -1) { + storeResult.Value = targetString.Value.Substring(startIndex.Value, length.Value); + } else { + storeResult.Value = targetString.Value.Substring(startIndex.Value); + } + return TaskStatus.Success; + } + + public override void OnReset() + { + targetString = ""; + startIndex = 0; + length = -1; + storeResult = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs.meta new file mode 100644 index 00000000..0849def5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/GetSubstring.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ce20430f88c32b418f29b42531eca4a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs new file mode 100644 index 00000000..b61c8eb1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Returns success if the string is null or empty")] + public class IsNullOrEmpty : Conditional + { + [Tooltip("The target string")] + public SharedString targetString; + + public override TaskStatus OnUpdate() + { + return string.IsNullOrEmpty(targetString.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetString = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs.meta new file mode 100644 index 00000000..9cb87727 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/IsNullOrEmpty.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f6f4d4c690c09bb48a388f36f4e30245 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs new file mode 100644 index 00000000..89db0f6e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Replaces a string with the new string")] + public class Replace : Action + { + [Tooltip("The target string")] + public SharedString targetString; + [Tooltip("The old replace")] + public SharedString oldString; + [Tooltip("The new string")] + public SharedString newString; + [Tooltip("The stored result")] + [RequiredField] + public SharedString storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = targetString.Value.Replace(oldString.Value, newString.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetString = ""; + oldString = ""; + newString = ""; + storeResult = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs.meta new file mode 100644 index 00000000..35f25181 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/Replace.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30fc7adfdddc39245a433ea477c01adf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs new file mode 100644 index 00000000..4aca34d0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs @@ -0,0 +1,28 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityString +{ + [TaskCategory("Basic/String")] + [TaskDescription("Sets the variable string to the value string.")] + public class SetString : Action + { + [Tooltip("The target string")] + [RequiredField] + public SharedString variable; + [Tooltip("The value string")] + public SharedString value; + + public override TaskStatus OnUpdate() + { + variable.Value = value.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + variable = ""; + value = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs.meta new file mode 100644 index 00000000..5c2c6bc4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/String/SetString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da59105cbc94b5d4da3c805897f4a099 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time.meta new file mode 100644 index 00000000..b7cb2612 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: d8d2d4d347504b146a2c930a2b806d71 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs new file mode 100644 index 00000000..75b87840 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime +{ + [TaskCategory("Basic/Time")] + [TaskDescription("Returns the time in seconds it took to complete the last frame.")] + public class GetDeltaTime : Action + { + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Time.deltaTime; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta new file mode 100644 index 00000000..a895d9d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetDeltaTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9d47b1b40fc1214298a3f6bfdc37e87 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs new file mode 100644 index 00000000..eb54ab7f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime +{ + [TaskCategory("Basic/Time")] + [TaskDescription("Returns the real time in seconds since the game started.")] + public class GetRealtimeSinceStartup : Action + { + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Time.realtimeSinceStartup; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta new file mode 100644 index 00000000..9c3e68ec --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetRealtimeSinceStartup.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c265b103d220b0e4fa45138fcd605f62 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs new file mode 100644 index 00000000..f0585de6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime +{ + [TaskCategory("Basic/Time")] + [TaskDescription("Returns the time in second since the start of the game.")] + public class GetTime : Action + { + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Time.time; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta new file mode 100644 index 00000000..fe77d1cd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTime.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5afd2ca3dda059243bf7a9156438475e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs new file mode 100644 index 00000000..7e5cf4f5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime +{ + [TaskCategory("Basic/Time")] + [TaskDescription("Returns the scale at which time is passing.")] + public class GetTimeScale : Action + { + [Tooltip("The variable to store the result")] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Time.timeScale; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta new file mode 100644 index 00000000..7835d60c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/GetTimeScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 79be8ba43b4c1db468d2476318e7e71a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs new file mode 100644 index 00000000..e02937e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs @@ -0,0 +1,23 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTime +{ + [TaskCategory("Basic/Time")] + [TaskDescription("Sets the scale at which time is passing.")] + public class SetTimeScale : Action + { + [Tooltip("The timescale")] + public SharedFloat timeScale; + + public override TaskStatus OnUpdate() + { + Time.timeScale = timeScale.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + timeScale.Value = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta new file mode 100644 index 00000000..9987e403 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Time/SetTimeScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6283d9f4bb690c64b9d986b6ff1271f0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform.meta new file mode 100644 index 00000000..9ea7e999 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: d2f1ebdae5c7ffb4d8c7a9daa37b5130 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs new file mode 100644 index 00000000..8f45f378 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Finds a transform by name. Returns Success.")] + public class Find : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The transform name to find")] + public SharedString transformName; + [Tooltip("The object found by name")] + [RequiredField] + public SharedTransform storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.Find(transformName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + transformName = null; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs.meta new file mode 100644 index 00000000..b0220ca3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Find.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 387fd22087393ab4e91f0ad4fce4e77f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs new file mode 100644 index 00000000..a6c31655 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Finds a child transform by name. Returns Success.")] + public class FindChild : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The transform name to find")] + public SharedString transformName; + [Tooltip("The object found by name")] + [RequiredField] + public SharedTransform storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.Find(transformName.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + transformName = null; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs.meta new file mode 100644 index 00000000..7f6d7a53 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/FindChild.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 62d28af7da95a12409245b2682550bcc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs new file mode 100644 index 00000000..cee67ccb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs @@ -0,0 +1,66 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Gets the Angle between a GameObject's forward direction and a target. Returns Success.")] + public class GetAngleToTarget : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The target object to measure the angle to. If null the targetPosition will be used.")] + public SharedGameObject targetObject; + [Tooltip("The world position to measure an angle to. If the targetObject is also not null, this value is used as an offset from that object's position.")] + public SharedVector3 targetPosition; + [Tooltip("Ignore height differences when calculating the angle?")] + public SharedBool ignoreHeight = true; + [Tooltip("The angle to the target")] + [RequiredField] + public SharedFloat storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + Vector3 targetPos; + if (targetObject.Value != null) { + targetPos = targetObject.Value.transform.InverseTransformPoint(targetPosition.Value); + } else { + targetPos = targetPosition.Value; + } + + if (ignoreHeight.Value) { + targetPos.y = targetTransform.position.y; + } + + var targetDir = targetPos - targetTransform.position; + storeValue.Value = Vector3.Angle(targetDir, targetTransform.forward); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + targetObject = null; + targetPosition = Vector3.zero; + ignoreHeight = true; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs.meta new file mode 100644 index 00000000..d34a2704 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetAngleToTarget.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae176a605fff9a2468198085313c26ad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs new file mode 100644 index 00000000..337e2341 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs @@ -0,0 +1,48 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the transform child at the specified index. Returns Success.")] + public class GetChild : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The index of the child")] + public SharedInt index; + [Tooltip("The child of the Transform")] + [RequiredField] + public SharedTransform storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.GetChild(index.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + index = 0; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs.meta new file mode 100644 index 00000000..a90dba3a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChild.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 04ea225bb12181a4daf7f3d6a21eaa5d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs new file mode 100644 index 00000000..aca95e80 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the number of children a Transform has. Returns Success.")] + public class GetChildCount : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The number of children")] + [RequiredField] + public SharedInt storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.childCount; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs.meta new file mode 100644 index 00000000..0ff26358 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetChildCount.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e31c13112e4d334ab9d67feaac94d3f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs new file mode 100644 index 00000000..a7764a8b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the euler angles of the Transform. Returns Success.")] + public class GetEulerAngles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The euler angles of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.eulerAngles; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs.meta new file mode 100644 index 00000000..0118e3b4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetEulerAngles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 43295a23f5d9cb345ae408d5ac843b52 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs new file mode 100644 index 00000000..0420db5b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the forward vector of the Transform. Returns Success.")] + public class GetForwardVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.forward; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs.meta new file mode 100644 index 00000000..6bda0d73 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetForwardVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5748c07a5ebe54429eb3e9ae032b5e2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs new file mode 100644 index 00000000..fee24dde --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the local euler angles of the Transform. Returns Success.")] + public class GetLocalEulerAngles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local euler angles of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.localEulerAngles; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs.meta new file mode 100644 index 00000000..40c781a6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalEulerAngles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 459c793e1b836104f901813471414ccc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs new file mode 100644 index 00000000..56737de6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the local position of the Transform. Returns Success.")] + public class GetLocalPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local position of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.localPosition; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs.meta new file mode 100644 index 00000000..57d121c8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4fdc0d751b2c91f438142cf65fcbba34 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs new file mode 100644 index 00000000..e2572ab1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the local rotation of the Transform. Returns Success.")] + public class GetLocalRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local rotation of the Transform")] + [RequiredField] + public SharedQuaternion storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.localRotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs.meta new file mode 100644 index 00000000..6cc867c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2334ddf0e58b67e40ad16e2f63dad8ee +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs new file mode 100644 index 00000000..bfdc2831 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the local scale of the Transform. Returns Success.")] + public class GetLocalScale : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local scale of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.localScale; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs.meta new file mode 100644 index 00000000..115bef16 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetLocalScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0b10fe3fcda1914fbbdde4a860cd403 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs new file mode 100644 index 00000000..53f2ee1e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the parent of the Transform. Returns Success.")] + public class GetParent : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The parent of the Transform")] + [RequiredField] + public SharedTransform storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.parent; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs.meta new file mode 100644 index 00000000..2dffa644 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetParent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f149245d8fce789498c301657a7eaf88 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs new file mode 100644 index 00000000..f6977b2e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs @@ -0,0 +1,50 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the position of the Transform. Returns Success.")] + public class GetPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Can the target GameObject be empty?")] + public SharedBool allowEmptyTarget; + [Tooltip("The position of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + if (!allowEmptyTarget.Value) { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.position; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + allowEmptyTarget = false; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs.meta new file mode 100644 index 00000000..207a32c8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ce1fdc3f652b3043b5116efba12cc48 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs new file mode 100644 index 00000000..370d14a9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the right vector of the Transform. Returns Success.")] + public class GetRightVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.right; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs.meta new file mode 100644 index 00000000..202902a1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRightVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b5147164f2674547888db24cba68770 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs new file mode 100644 index 00000000..d8a16aec --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the rotation of the Transform. Returns Success.")] + public class GetRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rotation of the Transform")] + [RequiredField] + public SharedQuaternion storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.rotation; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs.meta new file mode 100644 index 00000000..ca52e97b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5384b69809f40f5489ca7d7d345471d2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs new file mode 100644 index 00000000..e557b713 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs @@ -0,0 +1,45 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Stores the up vector of the Transform. Returns Success.")] + public class GetUpVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + [RequiredField] + public SharedVector3 storeValue; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + storeValue.Value = targetTransform.up; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + storeValue = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs.meta new file mode 100644 index 00000000..0e6f55a2 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/GetUpVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 605a7c93705031042be47bd4a4ab6079 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs new file mode 100644 index 00000000..4e4886b4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs @@ -0,0 +1,42 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Returns Success if the transform is a child of the specified GameObject.")] + public class IsChildOf : Conditional + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The interested transform")] + public SharedTransform transformName; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + return targetTransform.IsChildOf(transformName.Value) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + transformName = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs.meta new file mode 100644 index 00000000..9f93239e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/IsChildOf.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 304e488eb1caa4f45a8bd903292492ca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs new file mode 100644 index 00000000..bee3c7a9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Rotates the transform so the forward vector points at worldPosition. Returns Success.")] + public class LookAt : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Point to look at")] + public SharedVector3 worldPosition; + [Tooltip("Vector specifying the upward direction")] + public Vector3 worldUp; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.LookAt(worldPosition.Value, worldUp); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + worldPosition = Vector3.up; + worldUp = Vector3.up; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs.meta new file mode 100644 index 00000000..6e3189ff --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/LookAt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 64883614392671f438244b3aa5b91c6c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs new file mode 100644 index 00000000..267fe653 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Applies a rotation. Returns Success.")] + public class Rotate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Amount to rotate")] + public SharedVector3 eulerAngles; + [Tooltip("Specifies which axis the rotation is relative to")] + public Space relativeTo = Space.Self; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.Rotate(eulerAngles.Value, relativeTo); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + eulerAngles = Vector3.zero; + relativeTo = Space.Self; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs.meta new file mode 100644 index 00000000..b4a9c387 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Rotate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db0cba6372babb541a0da57412963760 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs new file mode 100644 index 00000000..ac3feb57 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs @@ -0,0 +1,50 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Applies a rotation. Returns Success.")] + public class RotateAround : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Point to rotate around")] + public SharedVector3 point; + [Tooltip("Axis to rotate around")] + public SharedVector3 axis; + [Tooltip("Amount to rotate")] + public SharedFloat angle; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.RotateAround(point.Value, axis.Value, angle.Value); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + point = Vector3.zero; + axis = Vector3.zero; + angle = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs.meta new file mode 100644 index 00000000..8bd780cc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/RotateAround.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65cef920fcc4ec449a1e6a29fe79c024 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs new file mode 100644 index 00000000..bc509186 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the euler angles of the Transform. Returns Success.")] + public class SetEulerAngles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The euler angles of the Transform")] + public SharedVector3 eulerAngles; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.eulerAngles = eulerAngles.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + eulerAngles = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs.meta new file mode 100644 index 00000000..4a20efd1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetEulerAngles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edad3f12ad10ba14aac656b7f431ff31 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs new file mode 100644 index 00000000..6deec202 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the forward vector of the Transform. Returns Success.")] + public class SetForwardVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + public SharedVector3 position; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.forward = position.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs.meta new file mode 100644 index 00000000..283c1b33 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetForwardVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4cf669b5419d7294cb72c90881267c0c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs new file mode 100644 index 00000000..fcb72a1a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the local euler angles of the Transform. Returns Success.")] + public class SetLocalEulerAngles : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local euler angles of the Transform")] + public SharedVector3 localEulerAngles; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.localEulerAngles = localEulerAngles.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + localEulerAngles = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs.meta new file mode 100644 index 00000000..644c7104 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalEulerAngles.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e1ed691ebf9f154e88bb8be7319baad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs new file mode 100644 index 00000000..9ef9f235 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the local position of the Transform. Returns Success.")] + public class SetLocalPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local position of the Transform")] + public SharedVector3 localPosition; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.localPosition = localPosition.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + localPosition = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs.meta new file mode 100644 index 00000000..53cc9193 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5af08673c7a3bb54c974bb23094d4587 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs new file mode 100644 index 00000000..f21d3b5a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the local rotation of the Transform. Returns Success.")] + public class SetLocalRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local rotation of the Transform")] + public SharedQuaternion localRotation; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.localRotation = localRotation.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + localRotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs.meta new file mode 100644 index 00000000..26baaac4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: de22c6e6826367540b2f25957757a1d4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs new file mode 100644 index 00000000..7b0f68ad --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the local scale of the Transform. Returns Success.")] + public class SetLocalScale : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The local scale of the Transform")] + public SharedVector3 localScale; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.localScale = localScale.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + localScale = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs.meta new file mode 100644 index 00000000..63025bea --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetLocalScale.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 354ce71974ea2b44ab820c8285f72421 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs new file mode 100644 index 00000000..92673a8a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the parent of the Transform. Returns Success.")] + public class SetParent : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The parent of the Transform")] + public SharedTransform parent; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.parent = parent.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + parent = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs.meta new file mode 100644 index 00000000..17981286 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetParent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a19c91d6c31b48d45b2ea97efeae14aa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs new file mode 100644 index 00000000..28bcf0b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the position of the Transform. Returns Success.")] + public class SetPosition : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + public SharedVector3 position; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.position = position.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs.meta new file mode 100644 index 00000000..1273580e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetPosition.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d0586a5078618624398df51fd677a2e0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs new file mode 100644 index 00000000..9479a024 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the right vector of the Transform. Returns Success.")] + public class SetRightVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + public SharedVector3 position; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.right = position.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs.meta new file mode 100644 index 00000000..a27cf794 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRightVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4629bee77af22ca42a716dfa8ad3e669 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs new file mode 100644 index 00000000..8885fa78 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the rotation of the Transform. Returns Success.")] + public class SetRotation : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The rotation of the Transform")] + public SharedQuaternion rotation; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.rotation = rotation.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + rotation = Quaternion.identity; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs.meta new file mode 100644 index 00000000..53f60e32 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetRotation.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb61cc6175ff14c4d84c3c72541bc30d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs new file mode 100644 index 00000000..8edbbc3b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Sets the up vector of the Transform. Returns Success.")] + public class SetUpVector : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("The position of the Transform")] + public SharedVector3 position; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.up = position.Value; + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + position = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs.meta new file mode 100644 index 00000000..4b2cc9fe --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/SetUpVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e65dee462c24694a9835796a770af6e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs new file mode 100644 index 00000000..bc636713 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityTransform +{ + [TaskCategory("Basic/Transform")] + [TaskDescription("Moves the transform in the direction and distance of translation. Returns Success.")] + public class Translate : Action + { + [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")] + public SharedGameObject targetGameObject; + [Tooltip("Move direction and distance")] + public SharedVector3 translation; + [Tooltip("Specifies which axis the rotation is relative to")] + public Space relativeTo = Space.Self; + + private Transform targetTransform; + private GameObject prevGameObject; + + public override void OnStart() + { + var currentGameObject = GetDefaultGameObject(targetGameObject.Value); + if (currentGameObject != prevGameObject) { + targetTransform = currentGameObject.GetComponent(); + prevGameObject = currentGameObject; + } + } + + public override TaskStatus OnUpdate() + { + if (targetTransform == null) { + Debug.LogWarning("Transform is null"); + return TaskStatus.Failure; + } + + targetTransform.Translate(translation.Value, relativeTo); + + return TaskStatus.Success; + } + + public override void OnReset() + { + targetGameObject = null; + translation = Vector3.zero; + relativeTo = Space.Self; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs.meta new file mode 100644 index 00000000..7a7a81b5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Transform/Translate.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d4a788705b79d3745a26867acf47a63a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2.meta new file mode 100644 index 00000000..a795f2e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: ea5a99c944135bb47be3809004f4ca10 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs new file mode 100644 index 00000000..c5f623ad --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Clamps the magnitude of the Vector2.")] + public class ClampMagnitude : Action + { + [Tooltip("The Vector2 to clamp the magnitude of")] + public SharedVector2 vector2Variable; + [Tooltip("The max length of the magnitude")] + public SharedFloat maxLength; + [Tooltip("The clamp magnitude resut")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.ClampMagnitude(vector2Variable.Value, maxLength.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = storeResult = Vector2.zero; + maxLength = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs.meta new file mode 100644 index 00000000..e11a61d7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/ClampMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2a5d2ecd681ef64ea5b5fbf81cc0b2d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs new file mode 100644 index 00000000..2cbd2c92 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Returns the distance between two Vector2s.")] + public class Distance : Action + { + [Tooltip("The first Vector2")] + public SharedVector2 firstVector2; + [Tooltip("The second Vector2")] + public SharedVector2 secondVector2; + [Tooltip("The distance")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.Distance(firstVector2.Value, secondVector2.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + firstVector2 = secondVector2 = Vector2.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs.meta new file mode 100644 index 00000000..389ce4b6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Distance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a35c2cb53a768894f8d81c2e8dc87b9b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs new file mode 100644 index 00000000..4af9ad76 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the dot product of two Vector2 values.")] + public class Dot : Action + { + [Tooltip("The left hand side of the dot product")] + public SharedVector2 leftHandSide; + [Tooltip("The right hand side of the dot product")] + public SharedVector2 rightHandSide; + [Tooltip("The dot product result")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.Dot(leftHandSide.Value, rightHandSide.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + leftHandSide = rightHandSide = Vector2.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs.meta new file mode 100644 index 00000000..6b58750a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Dot.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c9c233b5173aece4493146b736d4e65d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs new file mode 100644 index 00000000..859ad120 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the magnitude of the Vector2.")] + public class GetMagnitude : Action + { + [Tooltip("The Vector2 to get the magnitude of")] + public SharedVector2 vector2Variable; + [Tooltip("The magnitude of the vector")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector2Variable.Value.magnitude; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = Vector2.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs.meta new file mode 100644 index 00000000..6f801cb5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 64a63651c7294144197858c8b6387b49 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs new file mode 100644 index 00000000..cf72120f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the right vector value.")] + public class GetRightVector : Action + { + [Tooltip("The stored result")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.right; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs.meta new file mode 100644 index 00000000..94690766 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetRightVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f46062197c393bb4a809f7faf8e9fc70 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs new file mode 100644 index 00000000..d9e14486 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the square magnitude of the Vector2.")] + public class GetSqrMagnitude : Action + { + [Tooltip("The Vector2 to get the square magnitude of")] + public SharedVector2 vector2Variable; + [Tooltip("The square magnitude of the vector")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector2Variable.Value.sqrMagnitude; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = Vector2.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs.meta new file mode 100644 index 00000000..07dbd02b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetSqrMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5366ccb4258ea7f49ae280d05d2a195c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs new file mode 100644 index 00000000..0cd73e00 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the up vector value.")] + public class GetUpVector : Action + { + [Tooltip("The stored result")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.up; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs.meta new file mode 100644 index 00000000..0d51499d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetUpVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ec54e34058d3a04dbd9ed27538731b0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs new file mode 100644 index 00000000..f4d024f0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the Vector3 value of the Vector2.")] + public class GetVector3 : Action + { + [Tooltip("The Vector2 to get the Vector3 value of")] + public SharedVector2 vector3Variable; + [Tooltip("The Vector3 value")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector3Variable.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector2.zero; + storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs.meta new file mode 100644 index 00000000..f5233585 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetVector3.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89ba2f45bfecb9c40a4de0394c8019e0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs new file mode 100644 index 00000000..a9bae4d0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Stores the X and Y values of the Vector2.")] + public class GetXY : Action + { + [Tooltip("The Vector2 to get the values of")] + public SharedVector2 vector2Variable; + [Tooltip("The X value")] + [RequiredField] + public SharedFloat storeX; + [Tooltip("The Y value")] + [RequiredField] + public SharedFloat storeY; + + public override TaskStatus OnUpdate() + { + storeX.Value = vector2Variable.Value.x; + storeY.Value = vector2Variable.Value.y; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = Vector2.zero; + storeX = storeY = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs.meta new file mode 100644 index 00000000..8a640ee7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/GetXY.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e258a57c9873ecf4fb8a1432e418ecb4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs new file mode 100644 index 00000000..32c71287 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Lerp the Vector2 by an amount.")] + public class Lerp : Action + { + [Tooltip("The from value")] + public SharedVector2 fromVector2; + [Tooltip("The to value")] + public SharedVector2 toVector2; + [Tooltip("The amount to lerp")] + public SharedFloat lerpAmount; + [Tooltip("The lerp resut")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.Lerp(fromVector2.Value, toVector2.Value, lerpAmount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromVector2 = toVector2 = storeResult = Vector2.zero; + lerpAmount = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs.meta new file mode 100644 index 00000000..35226670 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Lerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f709035ad060c04d9f758980ad7e2c3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs new file mode 100644 index 00000000..c84fd517 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Move from the current position to the target position.")] + public class MoveTowards : Action + { + [Tooltip("The current position")] + public SharedVector2 currentPosition; + [Tooltip("The target position")] + public SharedVector2 targetPosition; + [Tooltip("The movement speed")] + public SharedFloat speed; + [Tooltip("The move resut")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector2.MoveTowards(currentPosition.Value, targetPosition.Value, speed.Value * Time.deltaTime); + return TaskStatus.Success; + } + + public override void OnReset() + { + currentPosition = targetPosition = storeResult = Vector2.zero; + speed = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs.meta new file mode 100644 index 00000000..f07218be --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/MoveTowards.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab464382cafa087498bef68f6988dff7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs new file mode 100644 index 00000000..3fccd123 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Multiply the Vector2 by a float.")] + public class Multiply : Action + { + [Tooltip("The Vector2 to multiply of")] + public SharedVector2 vector2Variable; + [Tooltip("The value to multiply the Vector2 of")] + public SharedFloat multiplyBy; + [Tooltip("The multiplication resut")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector2Variable.Value * multiplyBy.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = storeResult = Vector2.zero; + multiplyBy = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs.meta new file mode 100644 index 00000000..d736ec3d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Multiply.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7f21148eaa498684baa11ac8ac177599 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs new file mode 100644 index 00000000..cdd999b0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Normalize the Vector2.")] + public class Normalize : Action + { + [Tooltip("The Vector2 to normalize")] + public SharedVector2 vector2Variable; + [Tooltip("The normalized resut")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector2Variable.Value.normalized; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs.meta new file mode 100644 index 00000000..6d170e15 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Normalize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ed5b59611a512984f9755c358afc67d8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs new file mode 100644 index 00000000..36d9a29f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Performs a math operation on two Vector2s: Add, Subtract, Multiply, Divide, Min, or Max.")] + public class Operator : Action + { + public enum Operation + { + Add, + Subtract, + Scale + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first Vector2")] + public SharedVector2 firstVector2; + [Tooltip("The second Vector2")] + public SharedVector2 secondVector2; + [Tooltip("The variable to store the result")] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.Add: + storeResult.Value = firstVector2.Value + secondVector2.Value; + break; + case Operation.Subtract: + storeResult.Value = firstVector2.Value - secondVector2.Value; + break; + case Operation.Scale: + storeResult.Value = Vector2.Scale(firstVector2.Value, secondVector2.Value); + break; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + operation = Operation.Add; + firstVector2 = secondVector2 = storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs.meta new file mode 100644 index 00000000..7414ab28 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/Operator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ae8ac6f41714174fa63df41c7e32019 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs new file mode 100644 index 00000000..98c9d496 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Sets the value of the Vector2.")] + public class SetValue : Action + { + [Tooltip("The Vector2 to get the values of")] + public SharedVector2 vector2Value; + [Tooltip("The Vector2 to set the values of")] + public SharedVector2 vector2Variable; + + public override TaskStatus OnUpdate() + { + vector2Variable.Value = vector2Value.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Value = vector2Variable = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs.meta new file mode 100644 index 00000000..44d21ec4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61e3d384c43977148b829dab4090ab3b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs new file mode 100644 index 00000000..a4035d0f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector2 +{ + [TaskCategory("Basic/Vector2")] + [TaskDescription("Sets the X and Y values of the Vector2.")] + public class SetXY : Action + { + [Tooltip("The Vector2 to set the values of")] + public SharedVector2 vector2Variable; + [Tooltip("The X value. Set to None to have the value ignored")] + public SharedFloat xValue; + [Tooltip("The Y value. Set to None to have the value ignored")] + public SharedFloat yValue; + + public override TaskStatus OnUpdate() + { + var vector2Value = vector2Variable.Value; + if (!xValue.IsNone) { + vector2Value.x = xValue.Value; + } + if (!yValue.IsNone) { + vector2Value.y = yValue.Value; + } + vector2Variable.Value = vector2Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector2Variable = Vector2.zero; + xValue = yValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs.meta new file mode 100644 index 00000000..c7e52233 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector2/SetXY.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a24836a22bca9bd4ab701e35bf36f6a9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3.meta new file mode 100644 index 00000000..df1ddbe9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 65391955a7357ef4e82aa0214dc9b407 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs new file mode 100644 index 00000000..910ee6fe --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Returns the angle between two Vector3s.")] + public class Angle : Action + { + [Tooltip("The first Vector3")] + public SharedVector3 firstVector3; + [Tooltip("The second Vector3")] + public SharedVector3 secondVector3; + [Tooltip("The angle")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.Angle(firstVector3.Value, secondVector3.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + firstVector3 = secondVector3 = Vector3.zero; + storeResult = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs.meta new file mode 100644 index 00000000..60a69e2f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Angle.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e3b18a7f2f7db54992b881f449091ad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs new file mode 100644 index 00000000..c2a7c261 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Clamps the magnitude of the Vector3.")] + public class ClampMagnitude : Action + { + [Tooltip("The Vector3 to clamp the magnitude of")] + public SharedVector3 vector3Variable; + [Tooltip("The max length of the magnitude")] + public SharedFloat maxLength; + [Tooltip("The clamp magnitude resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.ClampMagnitude(vector3Variable.Value, maxLength.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = storeResult = Vector3.zero; + maxLength = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs.meta new file mode 100644 index 00000000..5d1bc9d7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/ClampMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3d2efd14a9499b47a17ea16bf45512f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs new file mode 100644 index 00000000..d8777328 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Returns the distance between two Vector3s.")] + public class Distance : Action + { + [Tooltip("The first Vector3")] + public SharedVector3 firstVector3; + [Tooltip("The second Vector3")] + public SharedVector3 secondVector3; + [Tooltip("The distance")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.Distance(firstVector3.Value, secondVector3.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + firstVector3 = secondVector3 = Vector3.zero; + storeResult = 0; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs.meta new file mode 100644 index 00000000..fbe88045 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Distance.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c4522b996b52d040822fb808cfc9d97 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs new file mode 100644 index 00000000..37daaa41 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the dot product of two Vector3 values.")] + public class Dot : Action + { + [Tooltip("The left hand side of the dot product")] + public SharedVector3 leftHandSide; + [Tooltip("The right hand side of the dot product")] + public SharedVector3 rightHandSide; + [Tooltip("The dot product result")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.Dot(leftHandSide.Value, rightHandSide.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + leftHandSide = rightHandSide = Vector3.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs.meta new file mode 100644 index 00000000..de0a620f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Dot.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe5e2655abffbe94eba3f6a0abd34b5c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs new file mode 100644 index 00000000..12c8b6fc --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the forward vector value.")] + public class GetForwardVector : Action + { + [Tooltip("The stored result")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.forward; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs.meta new file mode 100644 index 00000000..599a8210 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetForwardVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b09c11f987794eb45b65e0ef249cdb3f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs new file mode 100644 index 00000000..9bf51c68 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the magnitude of the Vector3.")] + public class GetMagnitude : Action + { + [Tooltip("The Vector3 to get the magnitude of")] + public SharedVector3 vector3Variable; + [Tooltip("The magnitude of the vector")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector3Variable.Value.magnitude; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector3.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs.meta new file mode 100644 index 00000000..c06d20e0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dcf2397966692fe4a819a0db18186778 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs new file mode 100644 index 00000000..ee8b33cf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the right vector value.")] + public class GetRightVector : Action + { + [Tooltip("The stored result")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.right; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs.meta new file mode 100644 index 00000000..654a6945 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetRightVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca338b1189144fe47ab9b1fa6a54e970 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs new file mode 100644 index 00000000..99fe0e2c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the square magnitude of the Vector3.")] + public class GetSqrMagnitude : Action + { + [Tooltip("The Vector3 to get the square magnitude of")] + public SharedVector3 vector3Variable; + [Tooltip("The square magnitude of the vector")] + [RequiredField] + public SharedFloat storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector3Variable.Value.sqrMagnitude; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector3.zero; + storeResult = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs.meta new file mode 100644 index 00000000..56daef6a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetSqrMagnitude.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb704714eacb92948bd59ddd38865b59 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs new file mode 100644 index 00000000..b6d270ae --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the up vector value.")] + public class GetUpVector : Action + { + [Tooltip("The stored result")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.up; + return TaskStatus.Success; + } + + public override void OnReset() + { + storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs.meta new file mode 100644 index 00000000..9601373f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetUpVector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 225a4566a02bdec4e82a2335b4e6c5fc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs new file mode 100644 index 00000000..db33cebd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the Vector2 value of the Vector3.")] + public class GetVector2 : Action + { + [Tooltip("The Vector3 to get the Vector2 value of")] + public SharedVector3 vector3Variable; + [Tooltip("The Vector2 value")] + [RequiredField] + public SharedVector2 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector3Variable.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector3.zero; + storeResult = Vector2.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs.meta new file mode 100644 index 00000000..76cebfab --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetVector2.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 959ed107c681b1c44af1b842ed7ca445 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs new file mode 100644 index 00000000..efed738a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Stores the X, Y, and Z values of the Vector3.")] + public class GetXYZ : Action + { + [Tooltip("The Vector3 to get the values of")] + public SharedVector3 vector3Variable; + [Tooltip("The X value")] + [RequiredField] + public SharedFloat storeX; + [Tooltip("The Y value")] + [RequiredField] + public SharedFloat storeY; + [Tooltip("The Z value")] + [RequiredField] + public SharedFloat storeZ; + + public override TaskStatus OnUpdate() + { + storeX.Value = vector3Variable.Value.x; + storeY.Value = vector3Variable.Value.y; + storeZ.Value = vector3Variable.Value.z; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector3.zero; + storeX = storeY = storeZ = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs.meta new file mode 100644 index 00000000..5cee68be --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/GetXYZ.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fbab043af227fe14e8875a1df65cbae4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs new file mode 100644 index 00000000..4819bc78 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Lerp the Vector3 by an amount.")] + public class Lerp : Action + { + [Tooltip("The from value")] + public SharedVector3 fromVector3; + [Tooltip("The to value")] + public SharedVector3 toVector3; + [Tooltip("The amount to lerp")] + public SharedFloat lerpAmount; + [Tooltip("The lerp resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.Lerp(fromVector3.Value, toVector3.Value, lerpAmount.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + fromVector3 = toVector3 = storeResult = Vector3.zero; + lerpAmount = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs.meta new file mode 100644 index 00000000..3304331f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Lerp.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef769062529820342a12a00e9cf8611d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs new file mode 100644 index 00000000..75d80cc4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs @@ -0,0 +1,31 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Move from the current position to the target position.")] + public class MoveTowards : Action + { + [Tooltip("The current position")] + public SharedVector3 currentPosition; + [Tooltip("The target position")] + public SharedVector3 targetPosition; + [Tooltip("The movement speed")] + public SharedFloat speed; + [Tooltip("The move resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.MoveTowards(currentPosition.Value, targetPosition.Value, speed.Value * Time.deltaTime); + return TaskStatus.Success; + } + + public override void OnReset() + { + currentPosition = targetPosition = storeResult = Vector3.zero; + speed = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs.meta new file mode 100644 index 00000000..7e9c4c19 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/MoveTowards.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6562a7b02f6ab1478612f41defc5299 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs new file mode 100644 index 00000000..9c693267 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs @@ -0,0 +1,29 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Multiply the Vector3 by a float.")] + public class Multiply : Action + { + [Tooltip("The Vector3 to multiply of")] + public SharedVector3 vector3Variable; + [Tooltip("The value to multiply the Vector3 of")] + public SharedFloat multiplyBy; + [Tooltip("The multiplication resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = vector3Variable.Value * multiplyBy.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = storeResult = Vector3.zero; + multiplyBy = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs.meta new file mode 100644 index 00000000..7bde7ce4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Multiply.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d1d7bd2678e229468abd363ac4a3dd6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs new file mode 100644 index 00000000..64c583b7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Normalize the Vector3.")] + public class Normalize : Action + { + [Tooltip("The Vector3 to normalize")] + public SharedVector3 vector3Variable; + [Tooltip("The normalized resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.Normalize(vector3Variable.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs.meta new file mode 100644 index 00000000..5cde0a68 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Normalize.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc8d58dc29ef6ab49a11e77f517e30ca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs new file mode 100644 index 00000000..fbb467ef --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs @@ -0,0 +1,47 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Performs a math operation on two Vector3s: Add, Subtract, Multiply, Divide, Min, or Max.")] + public class Operator : Action + { + public enum Operation + { + Add, + Subtract, + Scale + } + + [Tooltip("The operation to perform")] + public Operation operation; + [Tooltip("The first Vector3")] + public SharedVector3 firstVector3; + [Tooltip("The second Vector3")] + public SharedVector3 secondVector3; + [Tooltip("The variable to store the result")] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + switch (operation) { + case Operation.Add: + storeResult.Value = firstVector3.Value + secondVector3.Value; + break; + case Operation.Subtract: + storeResult.Value = firstVector3.Value - secondVector3.Value; + break; + case Operation.Scale: + storeResult.Value = Vector3.Scale(firstVector3.Value, secondVector3.Value); + break; + } + return TaskStatus.Success; + } + + public override void OnReset() + { + operation = Operation.Add; + firstVector3 = secondVector3 = storeResult = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs.meta new file mode 100644 index 00000000..96cbfbd6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/Operator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 606d84afee1cfbe4892d452884d36be8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs new file mode 100644 index 00000000..e012d875 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs @@ -0,0 +1,33 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Rotate the current rotation to the target rotation.")] + public class RotateTowards : Action + { + [Tooltip("The current rotation in euler angles")] + public SharedVector3 currentRotation; + [Tooltip("The target rotation in euler angles")] + public SharedVector3 targetRotation; + [Tooltip("The maximum delta of the degrees")] + public SharedFloat maxDegreesDelta; + [Tooltip("The maximum delta of the magnitude")] + public SharedFloat maxMagnitudeDelta; + [Tooltip("The rotation resut")] + [RequiredField] + public SharedVector3 storeResult; + + public override TaskStatus OnUpdate() + { + storeResult.Value = Vector3.RotateTowards(currentRotation.Value, targetRotation.Value, maxDegreesDelta.Value * Mathf.Deg2Rad * Time.deltaTime, maxMagnitudeDelta.Value); + return TaskStatus.Success; + } + + public override void OnReset() + { + currentRotation = targetRotation = storeResult = Vector3.zero; + maxDegreesDelta = maxMagnitudeDelta = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs.meta new file mode 100644 index 00000000..5847704a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/RotateTowards.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 55175ed9420ee88429fbb91a9b433b9c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs new file mode 100644 index 00000000..20034af0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Sets the value of the Vector3.")] + public class SetValue : Action + { + [Tooltip("The Vector3 to get the values of")] + public SharedVector3 vector3Value; + [Tooltip("The Vector3 to set the values of")] + public SharedVector3 vector3Variable; + + public override TaskStatus OnUpdate() + { + vector3Variable.Value = vector3Value.Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Value = vector3Variable = Vector3.zero; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs.meta new file mode 100644 index 00000000..d574f5ee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d512a8eb2bde4ea49868fdd746dafb0d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs new file mode 100644 index 00000000..82d466ca --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityVector3 +{ + [TaskCategory("Basic/Vector3")] + [TaskDescription("Sets the X, Y, and Z values of the Vector3.")] + public class SetXYZ : Action + { + [Tooltip("The Vector3 to set the values of")] + public SharedVector3 vector3Variable; + [Tooltip("The X value. Set to None to have the value ignored")] + public SharedFloat xValue; + [Tooltip("The Y value. Set to None to have the value ignored")] + public SharedFloat yValue; + [Tooltip("The Z value. Set to None to have the value ignored")] + public SharedFloat zValue; + + public override TaskStatus OnUpdate() + { + var vector3Value = vector3Variable.Value; + if (!xValue.IsNone) { + vector3Value.x = xValue.Value; + } + if (!yValue.IsNone) { + vector3Value.y = yValue.Value; + } + if (!zValue.IsNone) { + vector3Value.z = zValue.Value; + } + vector3Variable.Value = vector3Value; + return TaskStatus.Success; + } + + public override void OnReset() + { + vector3Variable = Vector3.zero; + xValue = yValue = zValue = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs.meta b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs.meta new file mode 100644 index 00000000..56cef77b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Basic Tasks/Vector3/SetXYZ.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: efcd4530935b0c445804e64d0820f27b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll b/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll new file mode 100644 index 00000000..3cc38782 Binary files /dev/null and b/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll differ diff --git a/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll.meta b/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll.meta new file mode 100644 index 00000000..f3ac4a1e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/BehaviorDesignerRuntime.dll.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8410c98bc8521734fbacf4a66e71c5a0 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Any: + enabled: 1 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs new file mode 100644 index 00000000..868201b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs @@ -0,0 +1,11 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime +{ + // Wrapper for the Behavior class + [AddComponentMenu("Behavior Designer/Behavior Tree")] + public class BehaviorTree : Behavior + { + // intentionally left blank + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs.meta b/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs.meta new file mode 100644 index 00000000..ea7b4efa --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/BehaviorTree.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8d7b55c7ecdb49a4a89fa5e6f9022861 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites.meta b/Client/Assets/Behavior Designer/Runtime/Composites.meta new file mode 100644 index 00000000..bd4bf8f1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 0728f016e441f9a48b8da3084d5668c9 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs b/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs new file mode 100644 index 00000000..79969d26 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs @@ -0,0 +1,87 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Similar to the sequence task, the parallel task will run each child task until a child task returns failure. " + + "The difference is that the parallel task will run all of its children tasks simultaneously versus running each task one at a time. " + + "Like the sequence class, the parallel task will return success once all of its children tasks have return success. " + + "If one tasks returns failure the parallel task will end all of the child tasks and return failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=27")] + [TaskIcon("{SkinColor}ParallelIcon.png")] + public class Parallel : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex; + // The task status of every child task. + private TaskStatus[] executionStatus; + + public override void OnAwake() + { + // Create a new task status array that will hold the execution status of all of the children tasks. + executionStatus = new TaskStatus[children.Count]; + } + + public override void OnChildStarted(int childIndex) + { + // One of the children has started to run. Increment the child index and set the current task status of that child to running. + currentChildIndex++; + executionStatus[childIndex] = TaskStatus.Running; + } + + public override bool CanRunParallelChildren() + { + // This task can run parallel children. + return true; + } + + public override int CurrentChildIndex() + { + return currentChildIndex; + } + + public override bool CanExecute() + { + // We can continue executing if we have more children that haven't been started yet. + return currentChildIndex < children.Count; + } + + public override void OnChildExecuted(int childIndex, TaskStatus childStatus) + { + // One of the children has finished running. Set the task status. + executionStatus[childIndex] = childStatus; + } + + public override TaskStatus OverrideStatus(TaskStatus status) + { + // Assume all of the children have finished executing. Loop through the execution status of every child and check to see if any tasks are currently running + // or failed. If a task is still running then all of the children are not done executing and the parallel task should continue to return a task status of running. + // If a task failed then return failure. The Behavior Manager will stop all of the children tasks. If no child task is running or has failed then the parallel + // task succeeded and it will return success. + bool childrenComplete = true; + for (int i = 0; i < executionStatus.Length; ++i) { + if (executionStatus[i] == TaskStatus.Running) { + childrenComplete = false; + } else if (executionStatus[i] == TaskStatus.Failure) { + return TaskStatus.Failure; + } + } + return (childrenComplete ? TaskStatus.Success : TaskStatus.Running); + } + + public override void OnConditionalAbort(int childIndex) + { + // Start from the beginning on an abort + currentChildIndex = 0; + for (int i = 0; i < executionStatus.Length; ++i) { + executionStatus[i] = TaskStatus.Inactive; + } + } + + public override void OnEnd() + { + // Reset the execution status and the child index back to their starting values. + for (int i = 0; i < executionStatus.Length; ++i) { + executionStatus[i] = TaskStatus.Inactive; + } + currentChildIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs.meta new file mode 100644 index 00000000..83e99844 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Parallel.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a7063721a0dbc04787bec1b0507f9ae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs b/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs new file mode 100644 index 00000000..13e6624a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs @@ -0,0 +1,87 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Similar to the selector task, the parallel selector task will return success as soon as a child task returns success. " + + "The difference is that the parallel task will run all of its children tasks simultaneously versus running each task one at a time. " + + "If one tasks returns success the parallel selector task will end all of the child tasks and return success. " + + "If every child task returns failure then the parallel selector task will return failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=28")] + [TaskIcon("{SkinColor}ParallelSelectorIcon.png")] + public class ParallelSelector : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex; + // The task status of every child task. + private TaskStatus[] executionStatus; + + public override void OnAwake() + { + // Create a new task status array that will hold the execution status of all of the children tasks. + executionStatus = new TaskStatus[children.Count]; + } + + public override void OnChildStarted(int childIndex) + { + // One of the children has started to run. Increment the child index and set the current task status of that child to running. + currentChildIndex++; + executionStatus[childIndex] = TaskStatus.Running; + } + + public override bool CanRunParallelChildren() + { + // This task can run parallel children. + return true; + } + + public override int CurrentChildIndex() + { + return currentChildIndex; + } + + public override bool CanExecute() + { + // We can continue executing if we have more children that haven't been started yet. + return currentChildIndex < children.Count; + } + + public override void OnChildExecuted(int childIndex, TaskStatus childStatus) + { + // One of the children has finished running. Set the task status. + executionStatus[childIndex] = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Start from the beginning on an abort + currentChildIndex = 0; + for (int i = 0; i < executionStatus.Length; ++i) { + executionStatus[i] = TaskStatus.Inactive; + } + } + + public override TaskStatus OverrideStatus(TaskStatus status) + { + // Assume all of the children have finished executing. Loop through the execution status of every child and check to see if any tasks are currently running + // or succeeded. If a task is still running then all of the children are not done executing and the parallel selector task should continue to return a task status of running. + // If a task succeeded then return success. The Behavior Manager will stop all of the children tasks. If no child task is running or has succeeded then the parallel selector + // task failed and it will return failure. + bool childrenComplete = true; + for (int i = 0; i < executionStatus.Length; ++i) { + if (executionStatus[i] == TaskStatus.Running) { + childrenComplete = false; + } else if (executionStatus[i] == TaskStatus.Success) { + return TaskStatus.Success; + } + } + return (childrenComplete ? TaskStatus.Failure : TaskStatus.Running); + } + + public override void OnEnd() + { + // Reset the execution status and the child index back to their starting values. + for (int i = 0; i < executionStatus.Length; ++i) { + executionStatus[i] = TaskStatus.Inactive; + } + currentChildIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs.meta new file mode 100644 index 00000000..37b9893c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/ParallelSelector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52e4e27ad95cedb41a3bc2c5f5ed0b54 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs b/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs new file mode 100644 index 00000000..5f2dac27 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs @@ -0,0 +1,72 @@ +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Similar to the selector task, the priority selector task will return success as soon as a child task returns success. " + + "Instead of running the tasks sequentially from left to right within the tree, the priority selector will ask the task what its priority is to determine the order. " + + "The higher priority tasks have a higher chance at being run first.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=29")] + [TaskIcon("{SkinColor}PrioritySelectorIcon.png")] + public class PrioritySelector : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex = 0; + // The task status of every child task. + private TaskStatus executionStatus = TaskStatus.Inactive; + // The order to run its children in. + private List childrenExecutionOrder = new List(); + + public override void OnStart() + { + // Make sure the list is empty before we add child indexes to it. + childrenExecutionOrder.Clear(); + + // Loop through each child task and determine its priority. The higher the priority the lower it goes within the list. The task with the highest + // priority will be first in the list and will be executed first. + for (int i = 0; i < children.Count; ++i) { + float priority = children[i].GetPriority(); + int insertIndex = childrenExecutionOrder.Count; + for (int j = 0; j < childrenExecutionOrder.Count; ++j) { + if (children[childrenExecutionOrder[j]].GetPriority() < priority) { + insertIndex = j; + break; + } + } + childrenExecutionOrder.Insert(insertIndex, i); + } + } + + public override int CurrentChildIndex() + { + // Use the execution order list in order to determine the current child index. + return childrenExecutionOrder[currentChildIndex]; + } + + public override bool CanExecute() + { + // We can continue to execuate as long as we have children that haven't been executed and no child has returned success. + return currentChildIndex < children.Count && executionStatus != TaskStatus.Success; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Increase the child index and update the execution status after a child has finished running. + currentChildIndex++; + executionStatus = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Set the current child index to the index that caused the abort + currentChildIndex = childIndex; + executionStatus = TaskStatus.Inactive; + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + currentChildIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs.meta new file mode 100644 index 00000000..fd866f4e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/PrioritySelector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b5aa86ad86e94f41841abd04bd96f2a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs new file mode 100644 index 00000000..ed625e1f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs @@ -0,0 +1,102 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Similar to the selector task, the random selector task will return success as soon as a child task returns success. " + + "The difference is that the random selector class will run its children in a random order. The selector task is deterministic " + + "in that it will always run the tasks from left to right within the tree. The random selector task shuffles the child tasks up and then begins " + + "execution in a random order. Other than that the random selector class is the same as the selector class. It will continue running tasks " + + "until a task completes successfully. If no child tasks return success then it will return failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=30")] + [TaskIcon("{SkinColor}RandomSelectorIcon.png")] + public class RandomSelector : Composite + { + [Tooltip("Seed the random number generator to make things easier to debug")] + public int seed = 0; + [Tooltip("Do we want to use the seed?")] + public bool useSeed = false; + + // A list of indexes of every child task. This list is used by the Fischer-Yates shuffle algorithm. + private List childIndexList = new List(); + // The random child index execution order. + private Stack childrenExecutionOrder = new Stack(); + // The task status of the last child ran. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override void OnAwake() + { + // If specified, use the seed provided. + if (useSeed) { + Random.InitState(seed); + } + + // Add the index of each child to a list to make the Fischer-Yates shuffle possible. + childIndexList.Clear(); + for (int i = 0; i < children.Count; ++i) { + childIndexList.Add(i); + } + } + + public override void OnStart() + { + // Randomize the indecies + ShuffleChilden(); + } + + public override int CurrentChildIndex() + { + // Peek will return the index at the top of the stack. + return childrenExecutionOrder.Peek(); + } + + public override bool CanExecute() + { + // Continue exectuion if no task has return success and indexes still exist on the stack. + return childrenExecutionOrder.Count > 0 && executionStatus != TaskStatus.Success; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Pop the top index from the stack and set the execution status. + if (childrenExecutionOrder.Count > 0) { + childrenExecutionOrder.Pop(); + } + executionStatus = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Start from the beginning on an abort + childrenExecutionOrder.Clear(); + executionStatus = TaskStatus.Inactive; + ShuffleChilden(); + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + childrenExecutionOrder.Clear(); + } + + public override void OnReset() + { + // Reset the public properties back to their original values + seed = 0; + useSeed = false; + } + + private void ShuffleChilden() + { + // Use Fischer-Yates shuffle to randomize the child index order. + for (int i = childIndexList.Count; i > 0; --i) { + int j = Random.Range(0, i); + int index = childIndexList[j]; + childrenExecutionOrder.Push(index); + childIndexList[j] = childIndexList[i - 1]; + childIndexList[i - 1] = index; + } + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs.meta new file mode 100644 index 00000000..1f33af10 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSelector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4952cbfc1e77be24b99e34c9acffc2a0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs new file mode 100644 index 00000000..0d4e2223 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs @@ -0,0 +1,103 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Similar to the sequence task, the random sequence task will return success as soon as every child task returns success. " + + "The difference is that the random sequence class will run its children in a random order. The sequence task is deterministic " + + "in that it will always run the tasks from left to right within the tree. The random sequence task shuffles the child tasks up and then begins " + + "execution in a random order. Other than that the random sequence class is the same as the sequence class. It will stop running tasks " + + "as soon as a single task ends in failure. On a task failure it will stop executing all of the child tasks and return failure. " + + "If no child returns failure then it will return success.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=31")] + [TaskIcon("{SkinColor}RandomSequenceIcon.png")] + public class RandomSequence : Composite + { + [Tooltip("Seed the random number generator to make things easier to debug")] + public int seed = 0; + [Tooltip("Do we want to use the seed?")] + public bool useSeed = false; + + // A list of indexes of every child task. This list is used by the Fischer-Yates shuffle algorithm. + private List childIndexList = new List(); + // The random child index execution order. + private Stack childrenExecutionOrder = new Stack(); + // The task status of the last child ran. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override void OnAwake() + { + // If specified, use the seed provided. + if (useSeed) { + Random.InitState(seed); + } + + // Add the index of each child to a list to make the Fischer-Yates shuffle possible. + childIndexList.Clear(); + for (int i = 0; i < children.Count; ++i) { + childIndexList.Add(i); + } + } + + public override void OnStart() + { + // Randomize the indecies + ShuffleChilden(); + } + + public override int CurrentChildIndex() + { + // Peek will return the index at the top of the stack. + return childrenExecutionOrder.Peek(); + } + + public override bool CanExecute() + { + // Continue exectuion if no task has return failure and indexes still exist on the stack. + return childrenExecutionOrder.Count > 0 && executionStatus != TaskStatus.Failure; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Pop the top index from the stack and set the execution status. + if (childrenExecutionOrder.Count > 0) { + childrenExecutionOrder.Pop(); + } + executionStatus = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Start from the beginning on an abort + childrenExecutionOrder.Clear(); + executionStatus = TaskStatus.Inactive; + ShuffleChilden(); + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + childrenExecutionOrder.Clear(); + } + + public override void OnReset() + { + // Reset the public properties back to their original values + seed = 0; + useSeed = false; + } + + private void ShuffleChilden() + { + // Use Fischer-Yates shuffle to randomize the child index order. + for (int i = childIndexList.Count; i > 0; --i) { + int j = Random.Range(0, i); + int index = childIndexList[j]; + childrenExecutionOrder.Push(index); + childIndexList[j] = childIndexList[i - 1]; + childIndexList[i - 1] = index; + } + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs.meta new file mode 100644 index 00000000..0f3ca379 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/RandomSequence.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11b102c97eb687b4a9ce1473a334c3dd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs b/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs new file mode 100644 index 00000000..e85b1ca5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs @@ -0,0 +1,46 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The selector task is similar to an \"or\" operation. It will return success as soon as one of its child tasks return success. " + + "If a child task returns failure then it will sequentially run the next task. If no child task returns success then it will return failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=26")] + [TaskIcon("{SkinColor}SelectorIcon.png")] + public class Selector : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex = 0; + // The task status of the last child ran. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override int CurrentChildIndex() + { + return currentChildIndex; + } + + public override bool CanExecute() + { + // We can continue to execuate as long as we have children that haven't been executed and no child has returned success. + return currentChildIndex < children.Count && executionStatus != TaskStatus.Success; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Increase the child index and update the execution status after a child has finished running. + currentChildIndex++; + executionStatus = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Set the current child index to the index that caused the abort + currentChildIndex = childIndex; + executionStatus = TaskStatus.Inactive; + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + currentChildIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs.meta new file mode 100644 index 00000000..3552ecf6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Selector.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7cb8dcec14880a443841212e6b595d4f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs b/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs new file mode 100644 index 00000000..08bd350c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs @@ -0,0 +1,120 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The selector evaluator is a selector task which reevaluates its children every tick. It will run the lowest priority child which returns a task status of running. " + + "This is done each tick. If a higher priority child is running and the next frame a lower priority child wants to run it will interrupt the higher priority child. " + + "The selector evaluator will return success as soon as the first child returns success otherwise it will keep trying higher priority children. This task mimics " + + "the conditional abort functionality except the child tasks don't always have to be conditional tasks.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=109")] + [TaskIcon("{SkinColor}SelectorEvaluatorIcon.png")] + public class SelectorEvaluator : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex = 0; + // The task status of the last child ran. + private TaskStatus executionStatus = TaskStatus.Inactive; + // The index of the child that was running before the tree started to be reevaluated. + private int storedCurrentChildIndex = -1; + // The task status of the last child ran before the tree started to be reevaluated. + private TaskStatus storedExecutionStatus = TaskStatus.Inactive; + + public override int CurrentChildIndex() + { + return currentChildIndex; + } + + public override void OnChildStarted(int childIndex) + { + // The children run sequentially so increment the index and set the status to running. + currentChildIndex++; + executionStatus = TaskStatus.Running; + } + + public override bool CanExecute() + { + // We can continue to execuate as long as we have children that haven't been executed and no child has returned success. + if (executionStatus == TaskStatus.Success || executionStatus == TaskStatus.Running) { + return false; + } + + // Used the storedCurrentChildIndex if reevaluating, otherwise the currentChildIndex + if (storedCurrentChildIndex != -1) { + return currentChildIndex < storedCurrentChildIndex - 1; + } + return currentChildIndex < children.Count; + } + + public override void OnChildExecuted(int childIndex, TaskStatus childStatus) + { + // The child status will be inactive immediately following an abort from OnReevaluationEnded. The status will be running if the + // child task is interrupted. Ignore the status for both of these. + if (childStatus != TaskStatus.Inactive && childStatus != TaskStatus.Running) { + executionStatus = childStatus; + } + } + + public override void OnConditionalAbort(int childIndex) + { + // Set the current child index to the index that caused the abort + currentChildIndex = childIndex; + executionStatus = TaskStatus.Inactive; + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + currentChildIndex = 0; + } + + public override TaskStatus OverrideStatus(TaskStatus status) + { + return executionStatus; + } + + // The selector evaluator task is a parallel task to allow the previous child to continue to run while the higher priority task is active. If the + // lower priority child can run then OnReevaluationEnded will interrupt the higher priority task. + public override bool CanRunParallelChildren() + { + return true; + } + + // Can reevaluate to allow the lower priority children the chance to rerun. + public override bool CanReevaluate() + { + return true; + } + + // The behavior tree wants to start reevaluating the tree. + public override bool OnReevaluationStarted() + { + // Cannot reevaluate if the task hasn't even started yet + if (executionStatus == TaskStatus.Inactive) { + return false; + } + + // Store the current index and execution status because it may need to be resumed. + storedCurrentChildIndex = currentChildIndex; + storedExecutionStatus = executionStatus; + currentChildIndex = 0; + executionStatus = TaskStatus.Inactive; + return true; + } + + // Reevaluation has ended. Determine if a task should be interrupted or resumed from the last index. + public override void OnReevaluationEnded(TaskStatus status) + { + // Interrupt the currently running index if a lower priority child returns a status of running or success. + if (executionStatus != TaskStatus.Failure && executionStatus != TaskStatus.Inactive) { + BehaviorManager.instance.Interrupt(Owner, children[storedCurrentChildIndex - 1], this); + } else { + // The lower priority children returned the same status so resume with the current child + currentChildIndex = storedCurrentChildIndex; + executionStatus = storedExecutionStatus; + } + storedCurrentChildIndex = -1; + storedExecutionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs.meta new file mode 100644 index 00000000..b55971ba --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/SelectorEvaluator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 15b5d0aafd7d4f04f8332d33705ebd63 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs b/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs new file mode 100644 index 00000000..c82ce730 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs @@ -0,0 +1,46 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The sequence task is similar to an \"and\" operation. It will return failure as soon as one of its child tasks return failure. " + + "If a child task returns success then it will sequentially run the next task. If all child tasks return success then it will return success.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=25")] + [TaskIcon("{SkinColor}SequenceIcon.png")] + public class Sequence : Composite + { + // The index of the child that is currently running or is about to run. + private int currentChildIndex = 0; + // The task status of the last child ran. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override int CurrentChildIndex() + { + return currentChildIndex; + } + + public override bool CanExecute() + { + // We can continue to execuate as long as we have children that haven't been executed and no child has returned failure. + return currentChildIndex < children.Count && executionStatus != TaskStatus.Failure; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Increase the child index and update the execution status after a child has finished running. + currentChildIndex++; + executionStatus = childStatus; + } + + public override void OnConditionalAbort(int childIndex) + { + // Set the current child index to the index that caused the abort + currentChildIndex = childIndex; + executionStatus = TaskStatus.Inactive; + } + + public override void OnEnd() + { + // All of the children have run. Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + currentChildIndex = 0; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs.meta b/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs.meta new file mode 100644 index 00000000..068578b3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Composites/Sequence.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b7226608b64066c40a656d7260249fce +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals.meta new file mode 100644 index 00000000..0e947132 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 71086b036fe4eb440ac8c7ff333239d6 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs new file mode 100644 index 00000000..b9c16252 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs @@ -0,0 +1,102 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success as soon as the event specified by eventName has been received.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=123")] + [TaskIcon("{SkinColor}HasReceivedEventIcon.png")] + public class HasReceivedEvent : Conditional + { + [Tooltip("The name of the event to receive")] + public SharedString eventName = ""; + [Tooltip("Optionally store the first sent argument")] + [SharedRequired] + public SharedVariable storedValue1; + [Tooltip("Optionally store the second sent argument")] + [SharedRequired] + public SharedVariable storedValue2; + [Tooltip("Optionally store the third sent argument")] + [SharedRequired] + public SharedVariable storedValue3; + + private bool eventReceived = false; + + public override void OnAwake() + { + // Let the behavior tree know that we are interested in receiving the event specified + Owner.RegisterEvent(eventName.Value, ReceivedEvent); + Owner.RegisterEvent(eventName.Value, ReceivedEvent); + Owner.RegisterEvent(eventName.Value, ReceivedEvent); + Owner.RegisterEvent(eventName.Value, ReceivedEvent); + } + + public override TaskStatus OnUpdate() + { + return eventReceived ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + eventReceived = false; + } + + private void ReceivedEvent() + { + eventReceived = true; + } + + private void ReceivedEvent(object arg1) + { + ReceivedEvent(); + + if (storedValue1 != null && !storedValue1.IsNone) { + storedValue1.SetValue(arg1); + } + } + + private void ReceivedEvent(object arg1, object arg2) + { + ReceivedEvent(); + + if (storedValue1 != null && !storedValue1.IsNone) { + storedValue1.SetValue(arg1); + } + + if (storedValue2 != null && !storedValue2.IsNone) { + storedValue2.SetValue(arg2); + } + } + + private void ReceivedEvent(object arg1, object arg2, object arg3) + { + ReceivedEvent(); + + if (storedValue1 != null && !storedValue1.IsNone) { + storedValue1.SetValue(arg1); + } + + if (storedValue2 != null && !storedValue2.IsNone) { + storedValue2.SetValue(arg2); + } + + if (storedValue3 != null && !storedValue3.IsNone) { + storedValue3.SetValue(arg3); + } + } + + public override void OnBehaviorComplete() + { + // Stop receiving the event when the behavior tree is complete + Owner.UnregisterEvent(eventName.Value, ReceivedEvent); + Owner.UnregisterEvent(eventName.Value, ReceivedEvent); + Owner.UnregisterEvent(eventName.Value, ReceivedEvent); + Owner.UnregisterEvent(eventName.Value, ReceivedEvent); + } + + public override void OnReset() + { + // Reset the properties back to their original values + eventName = ""; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs.meta new file mode 100644 index 00000000..9fd1d4e1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/HasReceivedEvent.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7c0c7f545b074cb48bd552b038ede7af +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics.meta new file mode 100644 index 00000000..cdb80d4e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 0c5a19b8daa7dbf4abe7505888ef0376 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs new file mode 100644 index 00000000..480e4093 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when a collision starts.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasEnteredCollision : Conditional + { + [Tooltip("The tag of the GameObject to check for a collision against")] + public SharedString tag = ""; + [Tooltip("The object that started the collision")] + public SharedGameObject collidedGameObject; + + private bool enteredCollision = false; + + public override TaskStatus OnUpdate() + { + return enteredCollision ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + enteredCollision = false; + } + + public override void OnCollisionEnter(Collision collision) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(collision.gameObject.tag)) { + collidedGameObject.Value = collision.gameObject; + enteredCollision = true; + } + } + + public override void OnReset() + { + tag = ""; + collidedGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs.meta new file mode 100644 index 00000000..b6f4d04b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1841a802d7ceda449423f001897ecae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs new file mode 100644 index 00000000..51feb050 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when a 2D collision starts.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasEnteredCollision2D : Conditional + { + [Tooltip("The tag of the GameObject to check for a collision against")] + public SharedString tag = ""; + [Tooltip("The object that started the collision")] + public SharedGameObject collidedGameObject; + + private bool enteredCollision = false; + + public override TaskStatus OnUpdate() + { + return enteredCollision ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + enteredCollision = false; + } + + public override void OnCollisionEnter2D(Collision2D collision) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(collision.gameObject.tag)) { + collidedGameObject.Value = collision.gameObject; + enteredCollision = true; + } + } + + public override void OnReset() + { + tag = ""; + collidedGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs.meta new file mode 100644 index 00000000..1f0e945e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredCollision2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ac128198630a2d4b9fee93cc9a1f8fd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs new file mode 100644 index 00000000..648850fd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when an object enters the trigger.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasEnteredTrigger : Conditional + { + [Tooltip("The tag of the GameObject to check for a trigger against")] + public SharedString tag = ""; + [Tooltip("The object that entered the trigger")] + public SharedGameObject otherGameObject; + + private bool enteredTrigger = false; + + public override TaskStatus OnUpdate() + { + return enteredTrigger ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + enteredTrigger = false; + } + + public override void OnTriggerEnter(Collider other) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(other.gameObject.tag)) { + otherGameObject.Value = other.gameObject; + enteredTrigger = true; + } + } + + public override void OnReset() + { + tag = ""; + otherGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs.meta new file mode 100644 index 00000000..bccb63ad --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5987844efe0fca7499cec04a9e3962cc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs new file mode 100644 index 00000000..05dfe9ec --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when an object enters the 2D trigger.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasEnteredTrigger2D : Conditional + { + [Tooltip("The tag of the GameObject to check for a trigger against")] + public SharedString tag = ""; + [Tooltip("The object that entered the trigger")] + public SharedGameObject otherGameObject; + + private bool enteredTrigger = false; + + public override TaskStatus OnUpdate() + { + return enteredTrigger ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + enteredTrigger = false; + } + + public override void OnTriggerEnter2D(Collider2D other) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(other.gameObject.tag)) { + otherGameObject.Value = other.gameObject; + enteredTrigger = true; + } + } + + public override void OnReset() + { + tag = ""; + otherGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs.meta new file mode 100644 index 00000000..4e98e7c7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasEnteredTrigger2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 84e2afb791fe67243a15e45e4af81bb4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs new file mode 100644 index 00000000..05a4fe3d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs @@ -0,0 +1,40 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when a collision ends.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasExitedCollision : Conditional + { + [Tooltip("The tag of the GameObject to check for a collision against")] + public SharedString tag = ""; + [Tooltip("The object that exited the collision")] + public SharedGameObject collidedGameObject; + + private bool exitedCollision = false; + + public override TaskStatus OnUpdate() + { + return exitedCollision ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + exitedCollision = false; + } + + public override void OnCollisionExit(Collision collision) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(collision.gameObject.tag)) { + collidedGameObject.Value = collision.gameObject; + exitedCollision = true; + } + } + + public override void OnReset() + { + collidedGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs.meta new file mode 100644 index 00000000..40e22c8b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 900905a3e42f74c49a6e503349ee651e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs new file mode 100644 index 00000000..e5a1a03a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when a 2D collision ends.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasExitedCollision2D : Conditional + { + [Tooltip("The tag of the GameObject to check for a collision against")] + public SharedString tag = ""; + [Tooltip("The object that exited the collision")] + public SharedGameObject collidedGameObject; + + private bool exitedCollision = false; + + public override TaskStatus OnUpdate() + { + return exitedCollision ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + exitedCollision = false; + } + + public override void OnCollisionExit2D(Collision2D collision) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(collision.gameObject.tag)) { + collidedGameObject.Value = collision.gameObject; + exitedCollision = true; + } + } + + public override void OnReset() + { + tag = ""; + collidedGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs.meta new file mode 100644 index 00000000..48510c2a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedCollision2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31cf8edd114ac5c4db22ec65babb3dd3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs new file mode 100644 index 00000000..ec33e923 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when an object exits the trigger.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasExitedTrigger : Conditional + { + [Tooltip("The tag of the GameObject to check for a trigger against")] + public SharedString tag = ""; + [Tooltip("The object that exited the trigger")] + public SharedGameObject otherGameObject; + + private bool exitedTrigger = false; + + public override TaskStatus OnUpdate() + { + return exitedTrigger ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + exitedTrigger = false; + } + + public override void OnTriggerExit(Collider other) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(other.gameObject.tag)) { + otherGameObject.Value = other.gameObject; + exitedTrigger = true; + } + } + + public override void OnReset() + { + tag = ""; + otherGameObject = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs.meta new file mode 100644 index 00000000..83c2828f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7ccd4a2c35d4c748b65ccd086e777e1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs new file mode 100644 index 00000000..95ad2f1a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs @@ -0,0 +1,41 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Returns success when an object exits the 2D trigger.")] + [TaskCategory("Physics")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=110")] + public class HasExitedTrigger2D : Conditional + { + [Tooltip("The tag of the GameObject to check for a trigger against")] + public SharedString tag = ""; + [Tooltip("The object that exited the trigger")] + public SharedGameObject otherGameObject; + + private bool exitedTrigger = false; + + public override TaskStatus OnUpdate() + { + return exitedTrigger ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnEnd() + { + exitedTrigger = false; + } + + public override void OnTriggerExit2D(Collider2D other) + { + if (string.IsNullOrEmpty(tag.Value) || tag.Value.Equals(other.gameObject.tag)) { + otherGameObject.Value = other.gameObject; + exitedTrigger = true; + } + } + + public override void OnReset() + { + tag = ""; + otherGameObject = null; + } + } +} diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs.meta new file mode 100644 index 00000000..3d6d4f8a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Physics/HasExitedTrigger2D.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ff0486d46da2f7844ac74c6e2ad5af89 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs new file mode 100644 index 00000000..a4c48c6f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The random probability task will return success when the random probability is above the succeed probability. It will otherwise return failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=33")] + public class RandomProbability : Conditional + { + [Tooltip("The chance that the task will return success")] + public SharedFloat successProbability = 0.5f; + [Tooltip("Seed the random number generator to make things easier to debug")] + public SharedInt seed; + [Tooltip("Do we want to use the seed?")] + public SharedBool useSeed; + + private System.Random random; + + public override void OnAwake() + { + // If specified, use the seed provided. + if (useSeed.Value) { + random = new System.Random(seed.Value); + } else { + random = new System.Random(); + } + } + + public override TaskStatus OnUpdate() + { + // Return success if random value is less than the success probability. Otherwise return failure. + float randomValue = (float)random.NextDouble(); + if (randomValue < successProbability.Value) { + return TaskStatus.Success; + } + return TaskStatus.Failure; + } + + public override void OnReset() + { + // Reset the public properties back to their original values + successProbability = 0.5f; + seed = 0; + useSeed = false; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs.meta new file mode 100644 index 00000000..85b11855 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/RandomProbability.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 468a21510e9558c49a47238ebe4c2270 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection.meta new file mode 100644 index 00000000..8e65537d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: caf1fead4d83193488aaa4560c36880c +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs new file mode 100644 index 00000000..d66bf706 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs @@ -0,0 +1,61 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Compares the field value to the value specified. Returns success if the values are the same.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=151")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class CompareFieldValue : Conditional + { + [Tooltip("The GameObject to compare the field on")] + public SharedGameObject targetGameObject; + [Tooltip("The component to compare the field on")] + public SharedString componentName; + [Tooltip("The name of the field")] + public SharedString fieldName; + [Tooltip("The value to compare to")] + public SharedVariable compareValue; + + public override TaskStatus OnUpdate() + { + if (compareValue == null) { + Debug.LogWarning("Unable to compare field - compare value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + Debug.LogWarning("Unable to compare field - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + Debug.LogWarning("Unable to compare the field with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var field = component.GetType().GetField(fieldName.Value); + var fieldValue = field.GetValue(component); + + if (fieldValue == null && compareValue.GetValue() == null) { + return TaskStatus.Success; + } + + return fieldValue.Equals(compareValue.GetValue()) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + fieldName = null; + compareValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs.meta new file mode 100644 index 00000000..42f0e6bb --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/CompareFieldValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc6496fb6757b684c8cc0c4ac8929319 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs new file mode 100644 index 00000000..4f7fbdf1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs @@ -0,0 +1,61 @@ +using UnityEngine; +using System; +using System.Reflection; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Compares the property value to the value specified. Returns success if the values are the same.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=152")] + [TaskCategory("Reflection")] + [TaskIcon("{SkinColor}ReflectionIcon.png")] + public class ComparePropertyValue : Conditional + { + [Tooltip("The GameObject to compare the property of")] + public SharedGameObject targetGameObject; + [Tooltip("The component to compare the property of")] + public SharedString componentName; + [Tooltip("The name of the property")] + public SharedString propertyName; + [Tooltip("The value to compare to")] + public SharedVariable compareValue; + + public override TaskStatus OnUpdate() + { + if (compareValue == null) { + Debug.LogWarning("Unable to compare field - compare value is null"); + return TaskStatus.Failure; + } + + var type = TaskUtility.GetTypeWithinAssembly(componentName.Value); + if (type == null) { + Debug.LogWarning("Unable to compare property - type is null"); + return TaskStatus.Failure; + } + + var component = GetDefaultGameObject(targetGameObject.Value).GetComponent(type); + if (component == null) { + Debug.LogWarning("Unable to compare the property with component " + componentName.Value); + return TaskStatus.Failure; + } + + // If you are receiving a compiler error on the Windows Store platform see this topic: + // http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=46 + var property = component.GetType().GetProperty(propertyName.Value); + var propertyValue = property.GetValue(component, null); + + if (propertyValue == null && compareValue.GetValue() == null) { + return TaskStatus.Success; + } + + return propertyValue.Equals(compareValue.GetValue()) ? TaskStatus.Success : TaskStatus.Failure; + } + + public override void OnReset() + { + targetGameObject = null; + componentName = null; + propertyName = null; + compareValue = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs.meta b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs.meta new file mode 100644 index 00000000..59fbef22 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Conditionals/Reflection/ComparePropertyValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8b0fa403f826a74087ece4b81fec1c7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators.meta b/Client/Assets/Behavior Designer/Runtime/Decorators.meta new file mode 100644 index 00000000..1368b027 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 97695fc9a59c6984d82dd3359c07ff3a +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs new file mode 100644 index 00000000..7c2c20f7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs @@ -0,0 +1,104 @@ +using UnityEngine; +using BehaviorDesigner.Runtime; +using BehaviorDesigner.Runtime.Tasks; + +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("Evaluates the specified conditional task. If the conditional task returns success then the child task is run and the child status is returned. If the conditional task does not " + + "return success then the child task is not run and a failure status is immediately returned.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=146")] + [TaskIcon("{SkinColor}ConditionalEvaluatorIcon.png")] + public class ConditionalEvaluator : Decorator + { + [Tooltip("Should the conditional task be reevaluated every tick?")] + public SharedBool reevaluate; + [InspectTask] + [Tooltip("The conditional task to evaluate")] + public Conditional conditionalTask; + + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + private bool checkConditionalTask = true; + private bool conditionalTaskFailed = false; + + public override void OnAwake() + { + if (conditionalTask != null) { + conditionalTask.Owner = Owner; + conditionalTask.GameObject = gameObject; + conditionalTask.Transform = transform; + conditionalTask.OnAwake(); + } + } + + public override void OnStart() + { + if (conditionalTask != null) { + conditionalTask.OnStart(); + } + } + + public override bool CanExecute() + { + // CanExecute is called when checking the condition within a while loop so it will be called at least twice. Ensure the conditional task is checked only once + if (checkConditionalTask) { + checkConditionalTask = false; + OnUpdate(); + } + + if (conditionalTaskFailed) { + return false; + } + return executionStatus == TaskStatus.Inactive || executionStatus == TaskStatus.Running; + } + + public override bool CanReevaluate() + { + return reevaluate.Value; + } + + public override TaskStatus OnUpdate() + { + var childStatus = conditionalTask.OnUpdate(); + conditionalTaskFailed = conditionalTask == null || childStatus == TaskStatus.Failure; + return childStatus; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override TaskStatus OverrideStatus() + { + // This version of OverrideStatus is called when the conditional evaluator fails reevaluation and has to stop all of its children. + // Therefore, the return status will always be failure + return TaskStatus.Failure; + } + + public override TaskStatus OverrideStatus(TaskStatus status) + { + if (conditionalTaskFailed) + return TaskStatus.Failure; + return status; + } + + public override void OnEnd() + { + // Reset the variables back to their starting values. + executionStatus = TaskStatus.Inactive; + checkConditionalTask = true; + conditionalTaskFailed = false; + if (conditionalTask != null) { + conditionalTask.OnEnd(); + } + } + + public override void OnReset() + { + // Reset the public properties back to their original values. + conditionalTask = null; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs.meta new file mode 100644 index 00000000..8f2340fd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ConditionalEvaluator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 632578e05169d1d45a1ab77ae8bb45ad +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs new file mode 100644 index 00000000..a7e575a6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs @@ -0,0 +1,49 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The interrupt task will stop all child tasks from running if it is interrupted. The interruption can be triggered by the perform interruption task. " + + "The interrupt task will keep running its child until this interruption is called. If no interruption happens and the child task completed its " + + "execution the interrupt task will return the value assigned by the child task.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=35")] + [TaskIcon("{SkinColor}InterruptIcon.png")] + public class Interrupt : Decorator + { + // When an interruption occurs return with this status. + private TaskStatus interruptStatus = TaskStatus.Failure; + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Continue executing until the child task returns success or failure. + return executionStatus == TaskStatus.Inactive || executionStatus == TaskStatus.Running; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public void DoInterrupt(TaskStatus status) + { + // An interruption has occurred. Update the interrupt status and notify the Behavior Manager. The Behavior Manager will stop all + // child tasks from running. + interruptStatus = status; + + BehaviorManager.instance.Interrupt(Owner, this); + } + + public override TaskStatus OverrideStatus() + { + // Return the interruption status as our status. + return interruptStatus; + } + + public override void OnEnd() + { + // Reset the variables back to their starting values. + interruptStatus = TaskStatus.Failure; + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs.meta new file mode 100644 index 00000000..b95c844c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Interrupt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81c44aaaa87500145831c0e167a5bfd3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs new file mode 100644 index 00000000..ce70d2f6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs @@ -0,0 +1,41 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The inverter task will invert the return value of the child task after it has finished executing. " + + "If the child returns success, the inverter task will return failure. If the child returns failure, the inverter task will return success.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=36")] + [TaskIcon("{SkinColor}InverterIcon.png")] + public class Inverter : Decorator + { + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Continue executing until the child task returns success or failure. + return executionStatus == TaskStatus.Inactive || executionStatus == TaskStatus.Running; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override TaskStatus Decorate(TaskStatus status) + { + // Invert the task status. + if (status == TaskStatus.Success) { + return TaskStatus.Failure; + } else if (status == TaskStatus.Failure) { + return TaskStatus.Success; + } + return status; + } + + public override void OnEnd() + { + // Reset the execution status back to its starting values. + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs.meta new file mode 100644 index 00000000..7c24be8a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Inverter.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 577fcf144ebc85642889f2dd11147272 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs new file mode 100644 index 00000000..b6c3d733 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs @@ -0,0 +1,48 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription(@"The repeater task will repeat execution of its child task until the child task has been run a specified number of times. " + + "It has the option of continuing to execute the child task even if the child task returns a failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=37")] + [TaskIcon("{SkinColor}RepeaterIcon.png")] + public class Repeater : Decorator + { + [Tooltip("The number of times to repeat the execution of its child task")] + public SharedInt count = 1; + [Tooltip("Allows the repeater to repeat forever")] + public SharedBool repeatForever; + [Tooltip("Should the task return if the child task returns a failure")] + public SharedBool endOnFailure; + + // The number of times the child task has been run. + private int executionCount = 0; + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Continue executing until we've reached the count or the child task returned failure and we should stop on a failure. + return (repeatForever.Value || executionCount < count.Value) && (!endOnFailure.Value || (endOnFailure.Value && executionStatus != TaskStatus.Failure)); + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // The child task has finished execution. Increase the execution count and update the execution status. + executionCount++; + executionStatus = childStatus; + } + + public override void OnEnd() + { + // Reset the variables back to their starting values. + executionCount = 0; + executionStatus = TaskStatus.Inactive; + } + + public override void OnReset() + { + // Reset the public properties back to their original values. + count = 0; + endOnFailure = true; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs.meta new file mode 100644 index 00000000..72b0fda5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/Repeater.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e62515fa6915f0d4f88b808e2e77d3ff +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs new file mode 100644 index 00000000..e76aa35c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs @@ -0,0 +1,39 @@ +using UnityEngine; +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The return failure task will always return failure except when the child task is running.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=38")] + [TaskIcon("{SkinColor}ReturnFailureIcon.png")] + public class ReturnFailure : Decorator + { + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Continue executing until the child task returns success or failure. + return executionStatus == TaskStatus.Inactive || executionStatus == TaskStatus.Running; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override TaskStatus Decorate(TaskStatus status) + { + // Return failure even if the child task returned success. + if (status == TaskStatus.Success) { + return TaskStatus.Failure; + } + return status; + } + + public override void OnEnd() + { + // Reset the execution status back to its starting values. + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs.meta new file mode 100644 index 00000000..f8a3c82d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnFailure.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f34d21f1bb4e761478bdf76222fcf135 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs new file mode 100644 index 00000000..e44e69d4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs @@ -0,0 +1,38 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The return success task will always return success except when the child task is running.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=39")] + [TaskIcon("{SkinColor}ReturnSuccessIcon.png")] + public class ReturnSuccess : Decorator + { + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Continue executing until the child task returns success or failure. + return executionStatus == TaskStatus.Inactive || executionStatus == TaskStatus.Running; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override TaskStatus Decorate(TaskStatus status) + { + // Return success even if the child task returned failure. + if (status == TaskStatus.Failure) { + return TaskStatus.Success; + } + return status; + } + + public override void OnEnd() + { + // Reset the execution status back to its starting values. + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs.meta new file mode 100644 index 00000000..88c9f2c4 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/ReturnSuccess.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 27d103b9f961fd44da3c4d83dadd90ca +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs new file mode 100644 index 00000000..86bb841e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs @@ -0,0 +1,77 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The task guard task is similar to a semaphore in multithreaded programming. The task guard task is there to ensure a limited resource is not being overused. " + + "\n\nFor example, you may place a task guard above a task that plays an animation. Elsewhere within your behavior tree you may also have another task that plays a different " + + "animation but uses the same bones for that animation. Because of this you don't want that animation to play twice at the same time. Placing a task guard will let you " + + "specify how many times a particular task can be accessed at the same time.\n\nIn the previous animation task example you would specify an access count of 1. With this setup " + + "the animation task can be only controlled by one task at a time. If the first task is playing the animation and a second task wants to control the animation as well, it will " + + "either have to wait or skip over the task completely.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=40")] + [TaskIcon("{SkinColor}TaskGuardIcon.png")] + public class TaskGuard : Decorator + { + [Tooltip("The number of times the child tasks can be accessed by parallel tasks at once")] + public SharedInt maxTaskAccessCount; + [Tooltip("The linked tasks that also guard a task. If the task guard is not linked against any other tasks it doesn't have much purpose. Marked as LinkedTask to " + + "ensure all tasks linked are linked to the same set of tasks")] + [LinkedTask] + public TaskGuard[] linkedTaskGuards = null; + [Tooltip("If true the task will wait until the child task is available. If false then any unavailable child tasks will be skipped over")] + public SharedBool waitUntilTaskAvailable; + + // The number of tasks that are currently using a particular task. + private int executingTasks = 0; + // True if the current task is executing. + private bool executing = false; + + public override bool CanExecute() + { + // The child task can execute if the number of executing tasks is less than the maximum number of tasks allowed. + return executingTasks < maxTaskAccessCount.Value && !executing; + } + + public override void OnChildStarted() + { + // The child task has started to run. Increase the executing tasks counter and notify all of the other linked tasks. + executingTasks++; + executing = true; + for (int i = 0; i < linkedTaskGuards.Length; ++i) { + linkedTaskGuards[i].taskExecuting(true); + } + } + + public override TaskStatus OverrideStatus(TaskStatus status) + { + // return a running status if the children are currently waiting for a task to become available + return (!executing && waitUntilTaskAvailable.Value) ? TaskStatus.Running : status; + } + + public void taskExecuting(bool increase) + { + // A linked task is currently executing a task that is being guarded. If the task just started executing then increase will be true and if it is ending then + // true will be false. + executingTasks += (increase ? 1 : -1); + } + + public override void OnEnd() + { + // The child task has been executed or skipped over. Only decrement the executing tasks count if the child task was being executed. Following that + // notify all of the linked tasks that we are done executing. + if (executing) { + executingTasks--; + for (int i = 0; i < linkedTaskGuards.Length; ++i) { + linkedTaskGuards[i].taskExecuting(false); + } + executing = false; + } + } + + public override void OnReset() + { + // Reset the public properties back to their original values + maxTaskAccessCount = null; + linkedTaskGuards = null; + waitUntilTaskAvailable = true; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs.meta new file mode 100644 index 00000000..9302e5bd --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/TaskGuard.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7e2ae4ab352f20c41be106f92efc3b43 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs new file mode 100644 index 00000000..4bcd2c5d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs @@ -0,0 +1,29 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The until failure task will keep executing its child task until the child task returns failure.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=41")] + [TaskIcon("{SkinColor}UntilFailureIcon.png")] + public class UntilFailure : Decorator + { + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Keep running until the child task returns failure. + return executionStatus == TaskStatus.Success || executionStatus == TaskStatus.Inactive; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override void OnEnd() + { + // Reset the execution status back to its starting values. + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs.meta new file mode 100644 index 00000000..4c09971c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilFailure.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 934b87f8f563272469cd9a9b14046ae7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs new file mode 100644 index 00000000..77e0f77b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs @@ -0,0 +1,29 @@ +namespace BehaviorDesigner.Runtime.Tasks +{ + [TaskDescription("The until success task will keep executing its child task until the child task returns success.")] + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=42")] + [TaskIcon("{SkinColor}UntilSuccessIcon.png")] + public class UntilSuccess : Decorator + { + // The status of the child after it has finished running. + private TaskStatus executionStatus = TaskStatus.Inactive; + + public override bool CanExecute() + { + // Keep running until the child task returns success. + return executionStatus == TaskStatus.Failure || executionStatus == TaskStatus.Inactive; + } + + public override void OnChildExecuted(TaskStatus childStatus) + { + // Update the execution status after a child has finished running. + executionStatus = childStatus; + } + + public override void OnEnd() + { + // Reset the execution status back to its starting values. + executionStatus = TaskStatus.Inactive; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs.meta b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs.meta new file mode 100644 index 00000000..0d832e40 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Decorators/UntilSuccess.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6d5c2cbf6c58f6b419831477bde98317 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/EntryTask.cs b/Client/Assets/Behavior Designer/Runtime/EntryTask.cs new file mode 100644 index 00000000..b82fb3d5 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/EntryTask.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime.Tasks +{ + // The entry task is a task that is used for display purposes within Behavior Designer to indicate the root of the tree. It is not a real task and + // cannot be used within the behavior tree. + [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=23")] + [TaskIcon("{SkinColor}EntryIcon.png")] + public class EntryTask : ParentTask + { + public override int MaxChildren() + { + return 1; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/EntryTask.cs.meta b/Client/Assets/Behavior Designer/Runtime/EntryTask.cs.meta new file mode 100644 index 00000000..5c7a4ce0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/EntryTask.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 143ae0c3fc255864893a532a2571f3d9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs new file mode 100644 index 00000000..aa9f51b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class ExternalBehaviorTree : ExternalBehavior + { + // intentionally left blank + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs.meta b/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs.meta new file mode 100644 index 00000000..6ef4f066 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/ExternalBehaviorTree.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b23f08d2ae4cba14087c1ed36193d82b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Object Drawers.meta b/Client/Assets/Behavior Designer/Runtime/Object Drawers.meta new file mode 100644 index 00000000..670a0100 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Object Drawers.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 29d0d8866b4fa984bbc7dbf5d988ebcc +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs b/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs new file mode 100644 index 00000000..d5dfe07d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs @@ -0,0 +1,16 @@ +using BehaviorDesigner.Runtime.Tasks; + +namespace BehaviorDesigner.Runtime.ObjectDrawers +{ + public class FloatSliderAttribute : ObjectDrawerAttribute + { + public float min; + public float max; + + public FloatSliderAttribute(float min, float max) + { + this.min = min; + this.max = max; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs.meta b/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs.meta new file mode 100644 index 00000000..3596e7a7 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Object Drawers/FloatSliderAttribute.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 92948bfcff9a1fc48834935ebb0dbdcb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs b/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs new file mode 100644 index 00000000..753df253 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs @@ -0,0 +1,16 @@ +using BehaviorDesigner.Runtime.Tasks; + +namespace BehaviorDesigner.Runtime.ObjectDrawers +{ + public class IntSliderAttribute : ObjectDrawerAttribute + { + public int min; + public int max; + + public IntSliderAttribute(int min, int max) + { + this.min = min; + this.max = max; + } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs.meta b/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs.meta new file mode 100644 index 00000000..5cb8e094 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Object Drawers/IntSliderAttribute.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2373bfe29d0e5bc47b88a46226aa6a61 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables.meta b/Client/Assets/Behavior Designer/Runtime/Variables.meta new file mode 100644 index 00000000..5fbd1bee --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: a52d5a185c5a1614f875fcb1828d78d8 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs new file mode 100644 index 00000000..43ba1b21 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedBool : SharedVariable + { + public static implicit operator SharedBool(bool value) { return new SharedBool { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs.meta new file mode 100644 index 00000000..24a56fe0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedBool.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2f4e02925f3d454c8a49a9f9cc1d497 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs new file mode 100644 index 00000000..50931845 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedColor : SharedVariable + { + public static implicit operator SharedColor(Color value) { return new SharedColor { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs.meta new file mode 100644 index 00000000..5cb6438b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedColor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1aebb6343767438449d67bf4118aeefe +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs new file mode 100644 index 00000000..5cfee32b --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs @@ -0,0 +1,8 @@ +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedFloat : SharedVariable + { + public static implicit operator SharedFloat(float value) { return new SharedFloat { Value = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs.meta new file mode 100644 index 00000000..f2d785c3 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedFloat.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 954735ce9c49fd845add7abd7883211c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs new file mode 100644 index 00000000..53f1ac29 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedGameObject : SharedVariable + { + public static implicit operator SharedGameObject(GameObject value) { return new SharedGameObject { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs.meta new file mode 100644 index 00000000..aee365b0 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: df84e4f8f0e526344a46be1b083e0218 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs new file mode 100644 index 00000000..b5760184 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedGameObjectList : SharedVariable> + { + public static implicit operator SharedGameObjectList(List value) { return new SharedGameObjectList { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs.meta new file mode 100644 index 00000000..956e5020 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedGameObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 70650d45c2fa6794a9fdd7d2a74bb59a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs new file mode 100644 index 00000000..9bd8e023 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedInt : SharedVariable + { + public static implicit operator SharedInt(int value) { return new SharedInt { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs.meta new file mode 100644 index 00000000..0f06a31e --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedInt.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 00de328b40e8ac84ebf75e48fe353f38 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs new file mode 100644 index 00000000..57afa4f6 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs @@ -0,0 +1,10 @@ +using UnityEngine; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedMaterial : SharedVariable + { + public static implicit operator SharedMaterial(Material value) { return new SharedMaterial { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs.meta new file mode 100644 index 00000000..c99828bf --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedMaterial.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e84514e0f685a64795ecdb776888407 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs new file mode 100644 index 00000000..c962aef8 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedObject : SharedVariable + { + public static explicit operator SharedObject(Object value) { return new SharedObject { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs.meta new file mode 100644 index 00000000..f9c153e9 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObject.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5ffddfc2d65c6e4ca1dedda5afd6ccc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs new file mode 100644 index 00000000..26092e6a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedObjectList : SharedVariable> + { + public static implicit operator SharedObjectList(List value) { return new SharedObjectList { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs.meta new file mode 100644 index 00000000..674f2268 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedObjectList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7644e981f746b5458fb6adbda412b2d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs new file mode 100644 index 00000000..e6f4e234 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedQuaternion : SharedVariable + { + public static implicit operator SharedQuaternion(Quaternion value) { return new SharedQuaternion { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs.meta new file mode 100644 index 00000000..027e0ace --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedQuaternion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1ec5ca504fe011b449506c42d3e5ac7f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs new file mode 100644 index 00000000..0c8ae3ae --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedRect : SharedVariable + { + public static implicit operator SharedRect(Rect value) { return new SharedRect { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs.meta new file mode 100644 index 00000000..68fded8a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedRect.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23ef607e9df5ab742afbea152c79eed5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs new file mode 100644 index 00000000..ccaf4c57 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedString : SharedVariable + { + public static implicit operator SharedString(string value) { return new SharedString { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs.meta new file mode 100644 index 00000000..a64cb255 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedString.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b562573ea4266848bc3f78352dca3a5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs new file mode 100644 index 00000000..7b06f98f --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedTransform : SharedVariable + { + public static implicit operator SharedTransform(Transform value) { return new SharedTransform { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs.meta new file mode 100644 index 00000000..226ae88d --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransform.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e084053b0dbe6541bc2408005c85606 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs new file mode 100644 index 00000000..6872404c --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedTransformList : SharedVariable> + { + public static implicit operator SharedTransformList(List value) { return new SharedTransformList { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs.meta new file mode 100644 index 00000000..33e37c1a --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedTransformList.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11f38abc81b11804aabe69ae80011a60 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs new file mode 100644 index 00000000..584f9d05 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedVector2 : SharedVariable + { + public static implicit operator SharedVector2(Vector2 value) { return new SharedVector2 { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs.meta new file mode 100644 index 00000000..4eb4d791 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector2.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2398d4531b638134384482dcac3e850c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs new file mode 100644 index 00000000..6c7652da --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedVector3 : SharedVariable + { + public static implicit operator SharedVector3(Vector3 value) { return new SharedVector3 { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs.meta new file mode 100644 index 00000000..6588f7ac --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector3.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2093670c041663d4096c217e7c790683 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs new file mode 100644 index 00000000..9d6f0549 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs @@ -0,0 +1,11 @@ +using UnityEngine; +using System.Collections; + +namespace BehaviorDesigner.Runtime +{ + [System.Serializable] + public class SharedVector4 : SharedVariable + { + public static implicit operator SharedVector4(Vector4 value) { return new SharedVector4 { mValue = value }; } + } +} \ No newline at end of file diff --git a/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs.meta b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs.meta new file mode 100644 index 00000000..b42454b1 --- /dev/null +++ b/Client/Assets/Behavior Designer/Runtime/Variables/SharedVector4.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e12e4a2550a6e5f4aa39fdd59126ed66 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: -- cgit v1.1-26-g67d0