1
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
"references": [
|
||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
||||
"GUID:4307f53044263cf4b835bd812fc161a4",
|
||||
"GUID:49b49c76ee64f6b41bf28ef951cb0e50"
|
||||
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
|
||||
"GUID:709caf8d7fb6ef24bbba0ab9962a3ad0",
|
||||
"GUID:7efac18f239530141802fb139776f333"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BITKit.Entities;
|
||||
using Cinemachine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITKit.Scene
|
||||
{
|
||||
public class CinemachineEntitiesGroup : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private IEntitiesService _entitiesService;
|
||||
[SerializeField] private CinemachineTargetGroup targetGroup;
|
||||
[SerializeField] private Optional<Entity[]> initialEntities;
|
||||
private void Update()
|
||||
{
|
||||
// foreach (var x in initialEntities.IfNotAllow(()=>_entitiesService.Query<IHealth>().Cast<Entity>().ToArray()))
|
||||
// {
|
||||
//
|
||||
// }
|
||||
targetGroup.m_Targets =
|
||||
initialEntities.IfNotAllow(() => _entitiesService.Query<IHealth>().Cast<Entity>().ToArray())
|
||||
.Select(x => new CinemachineTargetGroup.Target()
|
||||
{
|
||||
target = x.transform,
|
||||
radius = 1,
|
||||
weight = x.TryGetComponent<IHealth>(out var heal) ? heal.IsAlive ? 1 : 0 : 0
|
||||
})
|
||||
.ToArray();
|
||||
if (targetGroup.m_Targets.Length is 0)
|
||||
{
|
||||
targetGroup.m_Targets = initialEntities.IfNotAllow(() => _entitiesService.Query<IHealth>().Cast<Entity>().ToArray()).Select(
|
||||
x=>
|
||||
new CinemachineTargetGroup.Target()
|
||||
{
|
||||
target = x.transform,
|
||||
radius = 1,
|
||||
weight = 1
|
||||
}
|
||||
).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b26ced1633dbe440872ebd032cbc997
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -3,7 +3,6 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.Experimental.Audio;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
|
@@ -5,7 +5,6 @@ using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
using System.Linq;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using BITKit;
|
||||
using BITKit.UX;
|
||||
namespace BITKit.Editors
|
||||
@@ -24,18 +23,18 @@ namespace BITKit.Editors
|
||||
}
|
||||
public void CreateGUI()
|
||||
{
|
||||
root = Addressables.LoadAssetAsync<VisualTreeAsset>(nameof(ReferenceEditor)).WaitForCompletion().CloneTree();
|
||||
rootVisualElement.Add(root);
|
||||
|
||||
listView = root.Q<ListView>(UXConstant.ContextListView);
|
||||
|
||||
var allList = AssetDatabase
|
||||
.FindAssets($"t:{nameof(ReferenceSO)}")
|
||||
.Select(x => AssetDatabase.GUIDToAssetPath(x))
|
||||
.Select(x => AssetDatabase.LoadAssetAtPath<ReferenceSO>(x))
|
||||
.ToList();
|
||||
|
||||
listView.itemsSource = allList;
|
||||
// root = Addressables.LoadAssetAsync<VisualTreeAsset>(nameof(ReferenceEditor)).WaitForCompletion().CloneTree();
|
||||
// rootVisualElement.Add(root);
|
||||
//
|
||||
// listView = root.Q<ListView>(UXConstant.ContextListView);
|
||||
//
|
||||
// var allList = AssetDatabase
|
||||
// .FindAssets($"t:{nameof(ReferenceSO)}")
|
||||
// .Select(x => AssetDatabase.GUIDToAssetPath(x))
|
||||
// .Select(x => AssetDatabase.LoadAssetAtPath<ReferenceSO>(x))
|
||||
// .ToList();
|
||||
//
|
||||
// listView.itemsSource = allList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,10 @@ namespace BITKit
|
||||
public BBParameter<int> intParameter;
|
||||
public BBParameter<int> floatParameter;
|
||||
public BBParameter<string> stringParameter;
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{command}";
|
||||
}
|
||||
|
||||
protected override void OnExecute()
|
||||
{
|
||||
|
8
Src/UnityPluginsSupport/NodeCanvas/Pathfinding.meta
Normal file
8
Src/UnityPluginsSupport/NodeCanvas/Pathfinding.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e2a1c18f0c0d6348a76579e181a46d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using NodeCanvas.Framework;
|
||||
using ParadoxNotion.Design;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
namespace BITKit.NodeCanvas.Pathfinding
|
||||
{
|
||||
[Category("Pathfinding")]
|
||||
public class SetNavMeshAgentOptions : ActionTask<NavMeshAgent>
|
||||
{
|
||||
public BBParameter<bool> overrideUpdateRotation = false;
|
||||
public BBParameter<bool> overrideUpdatePosition = false;
|
||||
protected override void OnExecute()
|
||||
{
|
||||
agent.updateRotation = overrideUpdateRotation.value;
|
||||
agent.updatePosition = overrideUpdatePosition.value;
|
||||
EndAction();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 468f5391afee97e45b1925bcf7fe6e41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user