本文整理汇总了C#中AIState类的典型用法代码示例。如果您正苦于以下问题:C# AIState类的具体用法?C# AIState怎么用?C# AIState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AIState类属于命名空间,在下文中一共展示了AIState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IsSatisfied
/// <summary>
/// Determines whether this instance is satisfied.
/// </summary>
/// <param name="state">The state of the AI.</param>
/// <returns></returns>
/// <exception cref="System.Exception">Invalid equality type in IntCondtion.IsSatisfied().</exception>
public override bool IsSatisfied(AIState state)
{
var value = state.GetInt(ID);
if (!value.HasValue)
{
return false;
}
switch (Equality)
{
case EqualityType.Equals:
return value == Value;
case EqualityType.NotEquals:
return value != Value;
case EqualityType.GreaterThan:
return value > Value;
case EqualityType.LessThan:
return value < Value;
case EqualityType.GreaterThanOrEqual:
return value >= Value;
case EqualityType.LessThanOrEqual:
return value <= Value;
default:
throw new Exception("Invalid equality type in IntCondtion.IsSatisfied().");
}
}
开发者ID:JustinHughart,项目名称:LevvionAI,代码行数:33,代码来源:IntCondition.cs
示例2: Collided
public override void Collided()
{
switch (State)
{
case AIState.Patrolling:
Target = Position;
break;
case AIState.Chasing:
Target = Position;
State = AIState.FollowingPath;
break;
case AIState.FollowingPath:
Target = Position;
regeneratePath = true;
break;
case AIState.Attacking:
Target = Position;
//if ((Target - Position).Length() > 100f)
//{
// Target = Position;
// State = AIState.FollowingPath;
// regeneratePath = true;
//}
break;
}
base.Collided();
}
开发者ID:GarethIW,项目名称:Hunted,代码行数:28,代码来源:AIDude.cs
示例3: Reset
public void Reset()
{
transform.position = m_Player.transform.position + (-m_Player.transform.forward * m_DistanceFromPlayer);
m_Activated = false;
m_IsMoving = false;
m_State = AIState.IDLE;
}
开发者ID:jtabG,项目名称:Alone,代码行数:7,代码来源:AIRunnerBehaviour.cs
示例4: ChangeAIStateDelay
//couroutine change AI state with a delay time
IEnumerator ChangeAIStateDelay(AIState state, float time)
{
yield return new WaitForSeconds(time);
currentState = state;
iceChunkTimer = 1.0f;
StopCoroutine("ChangeAIStateDelay");
}
开发者ID:lamweilun,项目名称:FINAL_YEAR_PROJECT_MAJOR_CNB,代码行数:8,代码来源:IceBossBehaviour.cs
示例5: guard
public void guard()
{
releaseAI();
state = AIState.guard;
guardPos.parent = null;
ai.followTranform = guardPos;
}
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:7,代码来源:AICommand.cs
示例6: releaseAI
public void releaseAI()
{
state = AIState.free;
guardPos.parent = transform;
guardPos.localPosition = Vector3.zero;
ai.followTranform = null;
}
开发者ID:Seraphli,项目名称:TheInsectersWar,代码行数:7,代码来源:AICommand.cs
示例7: Enemy
public Enemy(String aiName,
Vector2 position)
: base(position,
Vector2.Zero,
Vector2.Zero,
new Vector2(MAX_VELOCITY_X, MAX_VELOCITY_Y),
new Vector2(ACCELERATION_X, ACCELERATION_Y),
new Vector2(DECELERATION_X, DECELERATION_Y),
TextureManager.GetTexture(TextureNames.PLAYER_TWO_IDLE))
{
behaviour = new AIStateMachine(XMLFILE, aiName);
currentState = behaviour.GetCurrentState();
// These should be loaded from either XML
// or be statics in child-classes specific
// to types of AIs.
moveTime = new ParameterDouble();
moveTime.alpha = 500;
moveTime.beta = 500;
moveTime.distribution = Distribution.Normal;
// Temporary:
timeBetweenFire = new ParameterDouble();
timeBetweenFire.alpha = 1000;
timeBetweenFire.beta = 1000;
timeBetweenFire.distribution = Distribution.Normal;
}
开发者ID:FranciscoCanas,项目名称:Crash.net,代码行数:27,代码来源:Enemy.cs
示例8: Start
// Use this for initialization
void Start ()
{
initPos = transform.position;
anim = gameObject.GetComponent<Animation> ();
aiState = AIState.Idle;
}
开发者ID:ErwinPS,项目名称:FreekickABC,代码行数:8,代码来源:GoalKeeperAI.cs
示例9: AIStateMachine
/**
* Constructor for manually-initialized AISMs
**/
public AIStateMachine(String aiName, int numStates, AIState[] stateNames, double[][] tmatrix)
{
machineName = aiName;
rtransition = new Random();
StateNames = new List<AIState>(numStates);
TransitionMatrix = new Double[numStates][];
Initialize(numStates, stateNames, tmatrix);
}
开发者ID:FranciscoCanas,项目名称:AIStateMachine,代码行数:11,代码来源:AIStateMachine.cs
示例10: SwitchState
/// <summary>
/// Forgets the old state and starts a new one.
/// </summary>
public void SwitchState(AIState state)
{
if (CurrentState != null)
stateStack.Pop().OnStop(actor);
stateStack.Push(state);
state.OnStart(actor);
}
开发者ID:AkiV,项目名称:Survival,代码行数:11,代码来源:StateMachine.cs
示例11: AICohere
public AICohere(AIState state, Transform obj, float weight){
trans = obj;
go = new GameObject();
average = go.transform;
this.State = state;
this.Weight = weight;
Targets = new Transform[]{};
}
开发者ID:paulaluri,项目名称:CMU-15-666,代码行数:8,代码来源:AICohere.cs
示例12: Awake
//init upon enabled, called faster than Start func
void Awake()
{
origPos = transform.position;
iceChunkArr = new GameObject[3];
currentState = AIState.state_Spawn_Self;
iceChunkTimer = 1.0f;
iceChunkPooler = transform.FindChild("iceChunkPooler");
}
开发者ID:lamweilun,项目名称:FINAL_YEAR_PROJECT_MAJOR_CNB,代码行数:9,代码来源:IceBossBehaviour.cs
示例13: Gateway
public Gateway(Game game, GraphicsDeviceManager graphics, Vector2 location)
: base(game, graphics, "content/gateway", true)
{
this.mLocation = location;
Random r = new Random();
mCurrentState = (AIState)r.Next(0, 2);
}
开发者ID:IainCargill,项目名称:froggerxna,代码行数:8,代码来源:Gateway.cs
示例14: PuckCollision
public void PuckCollision()
{
if (state == AIState.Attack)
{
state = AIState.Defense;
thinkTimer = 0.0f;
}
}
开发者ID:robert-porter,项目名称:AirHockey,代码行数:8,代码来源:AI.cs
示例15: Start
// Use this for initialization
void Start ()
{
initPos = transform.position;
anim = gameObject.GetComponent<Animation> ();
aiState = AIState.Idle;
anim["Jump1"].speed = 2;
anim["Jump2"].speed = 2;
anim["Jump3"].speed = 2;
}
开发者ID:ErwinPS,项目名称:FreekickABC,代码行数:10,代码来源:OpponentBlockerAI.cs
示例16: AiStateMachine
public AiStateMachine(Enemy owner, AIState constState, AIState startState)
{
this.owner = owner;
this.constState = constState;
this.dynamicState = startState;
constState.Enter(owner);
dynamicState.Enter(owner);
}
开发者ID:skakri09,项目名称:LabyrinthExplorer-XNA-3D-game,代码行数:9,代码来源:AiStateMachine.cs
示例17: Awake
void Awake()
{
currentState = AIState.state_Spawn_self;
leafPadPooler = transform.FindChild("leafPadPooler");
leafPadArr = new GameObject[4];
cannabisController = GetComponent<Animator>();
theSmoke = Instantiate(smoke, Vector2.zero, Quaternion.identity) as GameObject;
theSmoke.SetActive (false);
}
开发者ID:lamweilun,项目名称:FINAL_YEAR_PROJECT_MAJOR_CNB,代码行数:9,代码来源:CannabisBossBehaviour.cs
示例18: GetSubstates
public static AISubstate[] GetSubstates(AIState parent)
{
AISubstate[] substates = new AISubstate[3];
substates[0] = new AISubstate_GetSpace(parent);
substates[1] = new AISubstate_GetBehind(parent);
substates[2] = new AISubstate_Chase(parent); //maybe add missile lock state, maybe make it parallel
//substates[3] = new AISubstate_AttackEvade --> if shit hits the fan can add a straight up evasion goal, cancelling attack.
//if threat is tolerable blend attack vector with evasion vector. contains substates
//substates[4] = new AISubstate_AttackAvoidCollision --> similar to AttackEvade
return substates;
}
开发者ID:shaunvxc,项目名称:Infamy,代码行数:11,代码来源:AIState_Attack.cs
示例19: ShipAI
public ShipAI(Vector2 position, BulletManager bulletManager)
: base(position, bulletManager)
{
_state = AIState.Wandering;
MovementController.Rotation = _gen.Next(0, 360);
StatRecorder = new AIShipStatRecorder(this);
SeekingShip = -1;
Name = "CPU" + ID;
LevelManager.OnLevel += CheckReset;
}
开发者ID:AbhiLegend,项目名称:ShootR,代码行数:11,代码来源:ShipAI.cs
示例20: AISubstate
public AISubstate(AIState parentState)
{
this.parentState = parentState;
this.pilot = parentState.pilot;
this.entity = parentState.pilot.entity;
this.transform = entity.transform;
this.sensorSystem = entity.sensorSystem;
this.engineSystem = entity.engineSystem;
this.weaponSystem = entity.weaponSystem;
this.commSystem = entity.commSystem;
this.navSystem = entity.navSystem;
}
开发者ID:shaunvxc,项目名称:Infamy,代码行数:12,代码来源:AISubstate.cs
注:本文中的AIState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论