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);
    }
示例#3
0
    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);
        }
    }
示例#4
0
 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)));
        }
    }
示例#6
0
 public void Start()
 {
     area = GetComponentInParent <PersonalityQuarksArea>();
     foreach (FloatReference reference in GetComponents <FloatReference>())
     {
         if (reference.ReferenceTag == HealthReferenceTag)
         {
             healthReference = reference;
         }
     }
 }
示例#7
0
    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;
    }
示例#8
0
    // 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);
    }
示例#9
0
    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);
    }
示例#10
0
 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);
             }
         }
     }
 }
示例#11
0
    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);
    }
示例#12
0
 public override void ResetArea(PersonalityQuarksArea area)
 {
     Clear();
     SpawnWalls(area);
 }
示例#13
0
 public override void Initialize(BaseAgent agent)
 {
     area      = agent.gameObject.GetComponentInParent <PersonalityQuarksArea>();
     baseColor = agent.gameObject.GetComponent <Renderer>().material.color;
 }
示例#14
0
 // Start is called before the first frame update
 public override void Init(PersonalityQuarksArea area)
 {
     ResetArea(area);
 }
示例#15
0
 public abstract void ResetArea(PersonalityQuarksArea area);
示例#16
0
 public abstract void Init(PersonalityQuarksArea area);