This repository was archived by the owner on Apr 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed
Common/Scripts/AI/Graph/Actions Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,19 @@ namespace TheBitCave.TopDownEngineExensions.AI.Graph
1111 [ CreateNodeMenu ( "AI/Action/2D/Shoot" ) ]
1212 public class AIActionShoot2DNode : AIActionNode
1313 {
14+ // [Header("Binding")]
15+ // public CharacterHandleWeapon targetHandleWeaponAbility;
16+
17+ [ Header ( "Behaviour" ) ]
18+ public AIActionShoot2D . AimOrigins aimOrigin = AIActionShoot2D . AimOrigins . Transform ;
1419 public bool faceTarget = true ;
1520 public bool aimAtTarget = false ;
1621
1722 public override AIAction AddActionComponent ( GameObject go )
1823 {
1924 var action = go . AddComponent < AIActionShoot2D > ( ) ;
25+ // action.TargetHandleWeaponAbility = targetHandleWeaponAbility;
26+ action . AimOrigin = aimOrigin ;
2027 action . FaceTarget = faceTarget ;
2128 action . AimAtTarget = aimAtTarget ;
2229 action . Label = label ;
Original file line number Diff line number Diff line change @@ -11,13 +11,18 @@ namespace TheBitCave.TopDownEngineExensions.AI.Graph
1111 [ CreateNodeMenu ( "AI/Action/3D/Shoot" ) ]
1212 public class AIActionShoot3DNode : AIActionNode
1313 {
14+ // [Header("Binding")]
15+ // public CharacterHandleWeapon targetHandleWeaponAbility;
16+
17+ [ Header ( "Behaviour" ) ]
1418 public bool aimAtTarget = false ;
1519 public Vector3 shootOffset ;
1620 public bool lockVerticalAim = false ;
1721
1822 public override AIAction AddActionComponent ( GameObject go )
1923 {
2024 var action = go . AddComponent < AIActionShoot3D > ( ) ;
25+ // action.TargetHandleWeaponAbility = targetHandleWeaponAbility;
2126 action . AimAtTarget = aimAtTarget ;
2227 action . ShootOffset = shootOffset ;
2328 action . LockVerticalAim = lockVerticalAim ;
Original file line number Diff line number Diff line change @@ -7,17 +7,28 @@ namespace TheBitCave.TopDownEngineExensions.AI.Graph
77 [ CustomNodeEditor ( typeof ( AIActionShoot2DNode ) ) ]
88 public class AIActionShoot2DNodeEditor : AIActionNodeEditor
99 {
10+ // private SerializedProperty _targetHandleWeaponAbility;
11+ private SerializedProperty _aimOrigin ;
1012 private SerializedProperty _faceTarget ;
1113 private SerializedProperty _aimAtTarget ;
1214
1315 protected override void SerializeAdditionalProperties ( )
1416 {
17+ // _targetHandleWeaponAbility = serializedObject.FindProperty("targetHandleWeaponAbility");
18+ _aimOrigin = serializedObject . FindProperty ( "aimOrigin" ) ;
1519 _faceTarget = serializedObject . FindProperty ( "faceTarget" ) ;
1620 _aimAtTarget = serializedObject . FindProperty ( "aimAtTarget" ) ;
1721
1822 serializedObject . Update ( ) ;
23+ // NodeEditorGUILayout.PropertyField(_targetHandleWeaponAbility);
24+ NodeEditorGUILayout . PropertyField ( _aimOrigin ) ;
1925 NodeEditorGUILayout . PropertyField ( _faceTarget ) ;
2026 NodeEditorGUILayout . PropertyField ( _aimAtTarget ) ;
27+
28+ EditorGUILayout . HelpBox (
29+ "Target Handle Weapon Ability property is hidden. You will have to manually add it once the generator has been executed or assign it at runtime." ,
30+ MessageType . Warning ) ;
31+
2132 serializedObject . ApplyModifiedProperties ( ) ;
2233 }
2334 }
Original file line number Diff line number Diff line change @@ -7,21 +7,29 @@ namespace TheBitCave.TopDownEngineExensions.AI.Graph
77 [ CustomNodeEditor ( typeof ( AIActionShoot3DNode ) ) ]
88 public class AIActionShoot3DNodeEditor : AIActionNodeEditor
99 {
10+ // private SerializedProperty _targetHandleWeaponAbility;
1011 private SerializedProperty _aimAtTarget ;
1112 private SerializedProperty _shootOffset ;
1213 private SerializedProperty _lockVerticalAim ;
1314
1415 protected override void SerializeAdditionalProperties ( )
1516 {
17+ // _targetHandleWeaponAbility = serializedObject.FindProperty("targetHandleWeaponAbility");
1618 _aimAtTarget = serializedObject . FindProperty ( "aimAtTarget" ) ;
1719 _shootOffset = serializedObject . FindProperty ( "shootOffset" ) ;
1820 _lockVerticalAim = serializedObject . FindProperty ( "lockVerticalAim" ) ;
1921
2022 serializedObject . Update ( ) ;
2123 EditorGUIUtility . labelWidth = 105 ;
24+ // NodeEditorGUILayout.PropertyField(_targetHandleWeaponAbility);
2225 NodeEditorGUILayout . PropertyField ( _aimAtTarget ) ;
2326 NodeEditorGUILayout . PropertyField ( _shootOffset ) ;
2427 NodeEditorGUILayout . PropertyField ( _lockVerticalAim ) ;
28+
29+ EditorGUILayout . HelpBox (
30+ "Target Handle Weapon Ability property is hidden. You will have to manually add it once the generator has been executed or assign it at runtime." ,
31+ MessageType . Warning ) ;
32+
2533 serializedObject . ApplyModifiedProperties ( ) ;
2634 }
2735 }
You can’t perform that action at this time.
0 commit comments