void Awake() { person = this.gameObject.GetComponent <Person>(); command = GetComponent <Command>(); aware = GetComponent <Aware>(); visitors = GameObject.Find("Game Controller").GetComponent <s_PersonControl>(); gameplay = GameObject.Find("Game Controller").GetComponent <s_GamePlay>(); }
void Awake() { person = this.gameObject.GetComponent <Person>(); route = GameObject.Find("Game Controller").GetComponent <s_RouteControl>(); command = GetComponent <Command>(); aware = GetComponent <Aware>(); visitors = GameObject.Find("Game Controller").GetComponent <s_PersonControl>(); clicker = GameObject.Find("Game Controller").GetComponent <s_Clicker>(); }
void Awake() { //aiguard = transform.parent.GetComponent<AIGuard>(); command = transform.parent.GetComponent<Command>(); aware = this.transform.parent.GetComponent<Aware>(); aware.DetectionRange = this.gameObject.GetComponent<SphereCollider>(); me = this.gameObject.transform.parent.gameObject; }
//public Transform head; void Awake() { steerfortarget = gameObject.GetComponent <SteerForTarget>(); vehicle = this.gameObject.GetComponent <AutonomousVehicle>(); person = this.gameObject.GetComponent <Person>(); aware = this.gameObject.GetComponent <Aware>(); personControl = GameObject.Find("Game Controller").GetComponent <s_PersonControl>(); me = this.gameObject; sightdetect = this.gameObject.GetComponentInChildren <SightDetect>(); clicker = GameObject.Find("Game Controller").GetComponent <s_Clicker>(); }
public void LockCombat(GameObject enemy) { Person enemyPerson = enemy.GetComponent <Person>(); Command enemyCommand = enemy.GetComponent <Command>(); Aware enemyAware = enemy.GetComponent <Aware>(); Stop(); person.tech.state = Tech.State.combat; enemyCommand.Stop(); enemyPerson.tech.state = Tech.State.combat; bool existsDetectedList, existsHiddenList = false; //check if DETECTED list has skabengas, if it does, check it for DETECTED if (enemyAware.DetectedList.Count > 0) { existsDetectedList = enemyAware.DetectedList.Find(element => element == me); } else { existsDetectedList = false; } //check if HIDDEN list has skabengas, if it does, check it for DETECTED if (enemyAware.HiddenList.Count > 0) { existsHiddenList = enemyAware.HiddenList.Find(element => element == me); } else { existsHiddenList = false; } //if DETECTED is not found (is new) then add it to the appropriate list if (existsDetectedList == false && existsHiddenList == false) { enemyAware.DetectedList.Add(me); } if (existsDetectedList == false && existsHiddenList == true) { enemyAware.DetectedList.Add(me); enemyAware.HiddenList.Remove(me); } enemyAware.UserTarget = me; enemy.transform.LookAt(this.transform.position); }
public void BuildChecksConcreteTypeAndNotRequestedType() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(typeof(Aware), obj); Assert.IsTrue(obj.OnBuiltUp__Called); Assert.IsFalse(obj.OnTearingDown__Called); }
public void BuildChecksConcreteTypeAndNotRequestedType() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(new NamedTypeBuildKey <Aware>(), obj); Assert.True(obj.OnBuiltUpWasCalled); Assert.False(obj.OnTearingDownWasCalled); }
public void BuildChecksConcreteTypeAndNotRequestedType() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(new NamedTypeBuildKey<Aware>(), obj); Assert.IsTrue(obj.OnBuiltUp__Called); Assert.IsFalse(obj.OnTearingDown__Called); }
public void TearDownCallsClassWithInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteTearDown(obj); Assert.IsFalse(obj.OnBuiltUpWasCalled); Assert.IsTrue(obj.OnTearingDownWasCalled); }
public void TearDownCallsClassWithInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteTearDown(obj); Assert.False(obj.OnBuiltUpWasCalled); Assert.True(obj.OnTearingDownWasCalled); }
public void TearDownCallsClassWithInterface() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.HeadOfChain.TearDown(context, obj); Assert.False(obj.OnBuiltUp__Called); Assert.True(obj.OnTearingDown__Called); }
public void BuildChecksConcreteTypeAndNotRequestedType() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.HeadOfChain.BuildUp(context, typeof(Ignorant), obj); Assert.True(obj.OnBuiltUp__Called); Assert.False(obj.OnTearingDown__Called); }
public void BuildCallsClassWithInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(new NamedTypeBuildKey<Aware>(), obj); Assert.IsTrue(obj.OnBuiltUp__Called); Assert.IsFalse(obj.OnTearingDown__Called); Assert.AreEqual(new NamedTypeBuildKey<Aware>(), obj.OnBuiltUp_BuildKey); }
public void BuildCallsClassWithInterface() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.HeadOfChain.BuildUp(context, typeof(Aware), obj); Assert.True(obj.OnBuiltUp__Called); Assert.False(obj.OnTearingDown__Called); Assert.Equal <object>(typeof(Aware), obj.OnBuiltUp_BuildKey); }
public void BuildCallsClassWithInterface() { BuilderAwareStrategy strategy = new BuilderAwareStrategy(); MockBuilderContext context = new MockBuilderContext(); Aware obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(typeof(Aware), obj); Assert.IsTrue(obj.OnBuiltUp__Called); Assert.IsFalse(obj.OnTearingDown__Called); Assert.AreEqual(typeof(Aware), obj.OnBuiltUp_BuildKey); }
public void BuildCallsClassWithInterface() { var strategy = new BuilderAwareStrategy(); var context = new MockBuilderContext(); var obj = new Aware(); context.Strategies.Add(strategy); context.ExecuteBuildUp(new NamedTypeBuildKey <Aware>(), obj); Assert.True(obj.OnBuiltUpWasCalled); Assert.False(obj.OnTearingDownWasCalled); Assert.Equal(new NamedTypeBuildKey <Aware>(), obj.OnBuiltUpBuildKey); }
//public Transform head; void Awake() { steerfortarget = gameObject.GetComponent<SteerForTarget>(); vehicle = this.gameObject.GetComponent<AutonomousVehicle>(); person = this.gameObject.GetComponent<Person>(); aware = this.gameObject.GetComponent<Aware>(); personControl = GameObject.Find("Game Controller").GetComponent<s_PersonControl>(); me = this.gameObject; sightdetect = this.gameObject.GetComponentInChildren<SightDetect>(); clicker = GameObject.Find("Game Controller").GetComponent<s_Clicker>(); }
void Awake() { person = this.gameObject.GetComponent<Person>(); command = GetComponent<Command>(); aware = GetComponent<Aware>(); visitors = GameObject.Find("Game Controller").GetComponent<s_PersonControl>(); gameplay = GameObject.Find("Game Controller").GetComponent<s_GamePlay>(); }
void Awake() { person = this.gameObject.GetComponent<Person>(); route = GameObject.Find("Game Controller").GetComponent<s_RouteControl>(); command = GetComponent<Command>(); aware = GetComponent<Aware>(); visitors = GameObject.Find("Game Controller").GetComponent<s_PersonControl>(); clicker = GameObject.Find("Game Controller").GetComponent<s_Clicker>(); }