public override void Initialize(BaseAgent agent) { academy = agent.area.academy; Reward = AcademyParameters.FetchOrParse(academy, RewardKeyVal); myArea = agent.gameObject.GetComponentInParent <PersonalityQuarksArea>(); }
// Start is called before the first frame update public override void Init(PersonalityQuarksArea area) { SpawnNumber = (int)AcademyParameters.FetchOrParse(area.academy, SpawnNumberKeyVal); SpawnDistance = AcademyParameters.FetchOrParse(area.academy, SpawnDistanceKeyVal); ResetArea(area); }
public override void ResetArea(PersonalityQuarksArea area) { foreach (GameObject go in Spawned) { GameObject.Destroy(go); } Spawned.Clear(); int SpawnNumber = (int)AcademyParameters.FetchOrParse(area.academy, SpawnNumberKeyVal); for (int i = 0; i < SpawnNumber; i++) { GameObject gob = GameObject.Instantiate(Actor, new Vector3( Random.Range(-SpawnRange, SpawnRange), area.StartY + 0.5f, Random.Range(-SpawnRange, SpawnRange)), Quaternion.identity, area.gameObject.transform); if (area.EventSystem != null) { area.EventSystem.RaiseEvent(CreateEvent.Create(Actor.name, gob)); } Spawned.Add(gob); } }
public void Start() { if (area == null) { area = GetComponentInParent <PersonalityQuarksArea>(); } StartPosition = transform.position; StartRotation = transform.rotation; }
public void SpawnWalls(PersonalityQuarksArea area) { SpawnNumber = (int)AcademyParameters.Update(area.academy, SpawnNumberKeyVal, (int)SpawnNumber); SpawnDistance = AcademyParameters.Update(area.academy, SpawnDistanceKeyVal, SpawnDistance); for (int i = 0; i < SpawnNumber; i++) { SpawnWall(area, new Vector2(Random.Range(-SpawnDistance, SpawnDistance), Random.Range(-SpawnDistance, SpawnDistance))); } }
public void Start() { area = GetComponentInParent <PersonalityQuarksArea>(); foreach (FloatReference reference in GetComponents <FloatReference>()) { if (reference.ReferenceTag == HealthReferenceTag) { healthReference = reference; } } }
public override void ResetArea(PersonalityQuarksArea area) { if (last != null) { last.Clear(); } SpawnWallsArea prefab = mySpawns[(int)Random.Range(0, Spawns.Count)]; prefab.SpawnWalls(area); last = prefab; }
// Start is called before the first frame update public override void Init(PersonalityQuarksArea area) { foreach (SpawnWallsArea spawn in Spawns) { SpawnWallsArea mySpawn = Object.Instantiate(spawn); mySpawns.Add(mySpawn); mySpawn.ResetArea(area); mySpawn.Clear(); } ResetArea(area); }
public override void InitializeAgent() { base.InitializeAgent(); if (area == null) { area = GetComponentInParent <PersonalityQuarksArea>(); } Quarks = QuarkGroup.Instantiate(Quarks); Quarks.Initialize(this); // TAG: MakeEvent area.Logger.Log(Logger.CreateMessage(LogMessageType.World, $"Initialized {Quarks.name} {gameObject.name}"), this); }
public void Start() { if (!Started) { Started = true; area = GetComponentInParent <PersonalityQuarksArea>(); foreach (FloatReference reference in GetComponents <FloatReference>()) { if (reference.ReferenceTag == "health") { healthReference = reference; healthReference.Set(MaxHealth); } } } }
private void SpawnWall(PersonalityQuarksArea area, Vector2 position) { GameObject prefab = Walls[(int)Random.Range(0, Walls.Length)]; float SpawnHeight = prefab.transform.position.y; Quaternion rot = prefab.transform.rotation * Quaternion.AngleAxis(Random.Range(0, 360), Vector3.up); GameObject wall = GameObject.Instantiate( prefab, new Vector3(position.x, area.StartY + SpawnHeight, position.y), rot, area.gameObject.transform); if (area.EventSystem != null) { area.EventSystem.RaiseEvent(CreateEvent.Create(prefab.name, wall)); } Spawned.Add(wall); }
public override void ResetArea(PersonalityQuarksArea area) { Clear(); SpawnWalls(area); }
public override void Initialize(BaseAgent agent) { area = agent.gameObject.GetComponentInParent <PersonalityQuarksArea>(); baseColor = agent.gameObject.GetComponent <Renderer>().material.color; }
// Start is called before the first frame update public override void Init(PersonalityQuarksArea area) { ResetArea(area); }
public abstract void ResetArea(PersonalityQuarksArea area);
public abstract void Init(PersonalityQuarksArea area);