コード例 #1
0
        private void InstantiateCreatures()
        {
            foreach (var spawnLoc in TempData.creatureSetHashDic.Keys)
            {
                List <int> creatureHashes = new List <int>();
                int        rotTimes = TempData.creatureSetRotTimesDic[spawnLoc];
                int        cosine = (int)Mathf.Cos(rotTimes * 90 * Mathf.Deg2Rad);
                int        sine = (int)Mathf.Sin(rotTimes * 90 * Mathf.Deg2Rad);
                int        patternX, patternY;
                foreach (var ce in TempData.creatureSetHashDic[spawnLoc].GetCreatureSet().creatures)
                {
                    var cc = Instantiate(creaturePrefab, creatureHolder).GetComponent <CreatureController>();
                    patternX = ce.pattern.x * cosine + ce.pattern.y * sine;
                    patternY = -ce.pattern.x * sine + ce.pattern.y * cosine;
                    cc.InitCreature(ce.tCreature, new Location(patternX, patternY) + spawnLoc);
                    creatureHashes.Add(cc.Hash);
                    int distance = character.Loc.Distance(cc.Loc);
                    cc.SetVisual(distance < playerViewDistance);
                }
                RemainedCreatures.Add(spawnLoc, creatureHashes);

                var alertZone = new HashSet <Location>();
                foreach (var loc in spawnLoc.GetGivenDistancePoints(enemyViewDistance))
                {
                    alertZone.Add(loc);
                }
                AlertZone.Add(spawnLoc, alertZone);
            }

            if (RemainedCreatures.Count == 0 && TempData.GetAreaInfoType() == AreaType.Boss)
            {
                m_areaUIController.endStageButton.gameObject.SetActive(true);
            }
        }
コード例 #2
0
 protected override void Awake()
 {
     base.Awake();
     _alertZone         = GetComponentInChildren <AlertZone>();
     _path              = GetComponent <AIPath>();
     _destinationSetter = GetComponent <AIDestinationSetter>();
 }
コード例 #3
0
 public AlertableMotionProvider(AlertZone alertZone, IMotionProvider alertMotionProvider, IMotionProvider unalertMotionProvider)
 {
     _alertZone            = alertZone;
     AlertMotionProvider   = alertMotionProvider;
     UnalertMotionProvider = unalertMotionProvider;
 }