[AI] Behavior Actions 시스템 추가
Ultraworked with [Sisyphus](https://github.com/code-yeonggu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Unity.Behavior;
|
||||
using Unity.Properties;
|
||||
using Condition = Unity.Behavior.Condition;
|
||||
|
||||
namespace Colosseum.AI.BehaviorActions.Conditions
|
||||
{
|
||||
/// <summary>
|
||||
/// 무작위 확률로 성공/실패를 반환합니다.
|
||||
/// </summary>
|
||||
[Serializable, GeneratePropertyBag]
|
||||
[NodeDescription(name: "Random Chance", story: "Random chance of [Chance] percent", category: "Utility")]
|
||||
public partial class RandomChanceCondition : Condition
|
||||
{
|
||||
[SerializeReference]
|
||||
public BlackboardVariable<float> Chance = new BlackboardVariable<float>(50f);
|
||||
|
||||
public override bool IsTrue()
|
||||
{
|
||||
float roll = UnityEngine.Random.Range(0f, 100f);
|
||||
return roll <= Chance.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user