コード例 #1
0
    public override void Initialize()
    {
        base.Initialize();

        _gameItemDatabase = GameAccesPoint.Instance.mainGameState._gameItemDatabase;
        _herdHandler      = new HerdHandler(this);
    }
コード例 #2
0
    public Herd(HerdHandler parent, BaseHerdAnimal animalType, Vector3 worldLocation, int herdSize)
    {
        this.parent = parent;

        _startLocation = worldLocation;

        for (int i = 0; i < herdSize; i++)
        {
            Vector3        spawnPos      = new Vector3(worldLocation.x + i + 1, worldLocation.y, worldLocation.z);
            BaseHerdAnimal newHerdAnimal = Object.Instantiate(animalType);
            newHerdAnimal.OnCreate(spawnPos, Quaternion.identity);
            newHerdAnimal.AssignHerd(this);
            herdAnimals.Add(newHerdAnimal);
        }

        SetLeader();
    }