private void Awake() { _soldier = GetComponent <Soldier>(); _flag = FindObjectOfType <FlagComponent>(); AddPrecondition("hasFlag", true); // we must have the flag to drop it at the base AddEffect("hasFlag", false); // we will no longer have the flag after we drop it }
private void Awake() { _tm = FindObjectOfType <TeamManager>(); _soldier = GetComponent <Soldier>(); _flag = FindObjectOfType <FlagComponent>(); AddPrecondition("hasFlag", true); // we must have the flag to drop it at the base AddEffect("scored", true); // we will have dropped the flag once we finish AddEffect("hasFlag", false); // we will no longer have the flag after we drop it }
private void Awake() { _me = GetComponent <Soldier>(); _tm = FindObjectOfType <TeamManager>(); _flag = FindObjectOfType <FlagComponent>(); AddEffect("Captured", false); AddEffect("attacked", true); }
private void Awake() { AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag AddEffect("hasFlag", true); // we will have the flag after we picked it up // cache the flag _flag = FindObjectOfType <FlagComponent>(); Target = _flag.gameObject; }
public EntitiesWithFlagComponentEnumerable( FlagComponents[] flags, FlagComponent flag, int usedComponents ) { Flags = flags; Flag = flag; UsedComponents = usedComponents; }
//private TeamManager _tm; // Start is called before the first frame update private void Awake() { //_tm = FindObjectOfType<TeamManager>(); _soldier = GetComponent <ISoldier>(); //AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag //AddEffect("hasFlag", true); // we will have the flag after we picked it up // cache the flag _flag = FindObjectOfType <FlagComponent>(); //Target = GameObject.Find("NE"); }
protected override void Awake() { base.Awake(); AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag //AddPrecondition("dropFlag", false); AddEffect("hasFlag", true); // we will have the flag after we picked it up ActionName = General_Scripts.Enums.Actions.PickupFlag; // cache the flag _flag = FindObjectOfType <FlagComponent>(); Target = _flag.gameObject; }
public EntitiesWithFlagComponentEnumerator( FlagComponents[] flags, FlagComponent flag, int usedComponents ) { Current = default; Index = 1; // 0 is a magic number, never used so don't start there UsedComponents = usedComponents; Flags = flags; Flag = flag; }
private void Awake() { Flag = FindObjectOfType <FlagComponent>(); Army = FindObjectsOfType <Soldier>().ToList(); AllBases = new Dictionary <Base, bool>(); var allB = FindObjectsOfType <Base>().ToList(); foreach (var @base in allB) { AllBases.Add(@base, false); } OtherTeam = MyTeam == Teams.RedTeam ? Teams.BlueTeam : Teams.RedTeam; Enemies = FindObjectsOfType <MonoBehaviour>().OfType <ISoldier>().Where(s => s.MyTeam == OtherTeam).ToList(); }
public void ClearFlag(FlagComponent f) => SetFlags &= ~(ulong)f;
public void SetFlag(FlagComponent f) => SetFlags |= (ulong)f;
public bool HasFlag(FlagComponent f) => (SetFlags & (ulong)f) != 0;