private void Start() { if (isEnemy) { LevelManager.instance.RegisterEnemy(); } deathScript = GetComponent <DeathSystem>(); }
// Use this for initialization void Start() { MenuCanvas = GameObject.Find("CanvasMenu"); BlocageCube = GameObject.Find("BlocageCube"); DS = GameObject.Find("Player").GetComponent <DeathSystem>(); MenuCanvas.SetActive(false); //OCB = GameObject.Find ("ScriptManager").GetComponent<OpenCloseBook> (); }
void Start() { DeathSystem targetDeath = target.gameObject.GetComponent <DeathSystem>(); if (targetDeath != null) { targetDeath.RegisterDeathCallback(TargetDeath); } }
private void FindReferences() { m_ProductDisplayController = FindObjectOfType <ProductDisplayController>(); m_ClientSpawnSystem = FindObjectOfType <ClientSpawnSystem>(); m_ScoreSystem = FindObjectOfType <ScoreSystem>(); m_DeathSystem = FindObjectOfType <DeathSystem>(); m_ActorMovementController = GetComponent <ActorMovementController>(); m_ClientData = GetComponent <ClientData>(); }
// Use this for initialization void Start() { DS = GameObject.Find("Player").GetComponent <DeathSystem> (); MainCamera = GameObject.Find("Main Camera Main"); Player = GameObject.Find("Player"); artefactTuto = GameObject.Find("ArtefactTuto"); artefactTuto.SetActive(false); artefactSurFesses = GameObject.Find("ArtefactOnAss"); artefactSurUI = GameObject.Find("artefactNewCanvasChaudFroid"); DLM = GameObject.Find("SmallItem1").GetComponent <DetectableLocalManager> (); }
// Use this for initialization void Start() { VBBC = GameObject.Find("BlocageCube").GetComponent <VillageDecouvertBlocageCube> (); DLM = GameObject.Find("Town1").GetComponent <DetectableLocalManager> (); SG = GameObject.Find("Player").GetComponent <SanityGestion>(); DS = GameObject.Find("Player").GetComponent <DeathSystem>(); MainCamera = GameObject.Find("Main Camera Main"); Player = GameObject.Find("Player"); RespawnEnigmeTotem = GameObject.Find("RespawnEnigmeTotem").transform; }
// Use this for initialization and enforcing singleton void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
private void InitializeEnemyComponents(GameObject enemy) { Transform spawn = GetRandomSpawner(); if (spawn != null) { NavMeshAgent agent = enemy.GetComponent <NavMeshAgent>(); // disable the nav mesh agent to prevent a bug with the enemy spawning in the wrong location if (agent != null) { agent.enabled = false; } // set the spawn point enemy.transform.position = spawn.position; // move the enemy in a radius around the spawn point Vector2 radius = Random.insideUnitCircle * 10.0f; enemy.transform.Translate(radius.x, 0.0f, radius.y); // if the enemy uses a MoveTowardsTarget script, the target needs to be set ITargetBasedMovement moveTowards = enemy.GetComponent(typeof(ITargetBasedMovement)) as ITargetBasedMovement; if (moveTowards != null) { moveTowards.target = GameObject.FindGameObjectWithTag("Player").transform; } // register for death notification DeathSystem enemyDeath = enemy.GetComponent <DeathSystem>(); if (enemyDeath != null) { enemyDeath.RegisterDeathCallback(EnemyDeathCallback); } //increment live enemy count enemyCount++; // re-enable the nav mesh agent if (agent != null) { agent.enabled = true; } } }
void BossDied(GameObject bossObject) { ImportantPeopleDied(bossObject); // make player invincible then destroy all the enemies player.GetComponent <HealthSystem>().immune = true; foreach (GameObject enemy in GameObject.FindGameObjectsWithTag("Enemy")) { DeathSystem enemyDeath = enemy.GetComponent <DeathSystem>(); if (enemyDeath != null) { enemyDeath.KillDelayed(Random.Range(0.5f, 1.5f)); } else { Destroy(enemy); } } }
private void Start() { _Death = GetComponent <DeathSystem>(); }
protected override void OnCreate() { inputSystem = World.GetOrCreateSystem <InputSystem>(); selectionSystem = World.GetOrCreateSystem <SelectionSystem>(); lockstepSystemGroup = World.GetOrCreateSystem <LockstepSystemGroup>(); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <CommandExecutionSystem>()); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <VolatileCommandSystem>()); lockstepSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem <CommandableSafetySystem>()); blockMovementSystem = World.GetOrCreateSystem <BlockMovementSystem>(); onGroupCheckSystem = World.GetOrCreateSystem <OnGroupCheckSystem>(); updateReachableHexListSystem = World.GetOrCreateSystem <UpdateReachableHexListSystem>(); resourceSourceManagerSystem = World.GetOrCreateSystem <ResourceSourceManagerSystem>(); triggerGatherSystem = World.GetOrCreateSystem <TriggerGatherSystem>(); dropPointSystem = World.GetOrCreateSystem <DropPointSystem>(); triggerUpdateResBufferSystem = World.GetOrCreateSystem <TriggerUpdateResBufferSystem>(); updateResourceBufferSystem = World.GetOrCreateSystem <UpdateResourceBufferSystem>(); updateOcupationMapSystem = World.GetOrCreateSystem <UpdateOcupationMapSystem>(); updateDestinationSystem = World.GetOrCreateSystem <UpdateDestinationSystem>(); sightSystem = World.GetOrCreateSystem <SightSystem>(); pathRefreshSystem = World.GetOrCreateSystem <PathRefreshSystem>(); pathFindingSystem = World.GetOrCreateSystem <PathFindingSystem>(); pathChangeIndexSystem = World.GetOrCreateSystem <PathChangeIndexSystem>(); findPosibleTargetsSystem = World.GetOrCreateSystem <FindPosibleTargetsSystem>(); findActionTargetSystem = World.GetOrCreateSystem <FindActionTargetSystem>(); findMovementTargetSystem = World.GetOrCreateSystem <FindMovementTargetSystem>(); steeringSystem = World.GetOrCreateSystem <SteeringSystem>(); translationSystem = World.GetOrCreateSystem <TranslationSystem>(); movementFinisherSystem = World.GetOrCreateSystem <MovementFinisherSystem>(); collisionSystem = World.GetOrCreateSystem <CollisionSystem>(); directionSystem = World.GetOrCreateSystem <DirectionSystem>(); startActSystem = World.GetOrCreateSystem <StartActSystem>(); removeReceivingActComponentsSystem = World.GetOrCreateSystem <RemoveReceivingActComponentsSystem>(); initReceivingActComponentsSystem = World.GetOrCreateSystem <InitReceivingActComponentsSystem>(); attackSystem = World.GetOrCreateSystem <AttackSystem>(); receiveDamageSystem = World.GetOrCreateSystem <ReceiveDamageSystem>(); gatherSystem = World.GetOrCreateSystem <GatherSystem>(); extractResourceSystem = World.GetOrCreateSystem <ExtractResourceSystem>(); updateGathererAmmountSystem = World.GetOrCreateSystem <UpdateGathererAmmountSystem>(); endActionSystem = World.GetOrCreateSystem <EndActionSystem>(); resourceSystem = World.GetOrCreateSystem <ResourceSystem>(); deathSystem = World.GetOrCreateSystem <DeathSystem>(); //simulationSystemGroup = World.GetOrCreateSystem<SimulationSystemGroup>(); //simulationSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem<PathFindingSystem>()); //simulationSystemGroup.AddSystemToUpdateList(World.GetOrCreateSystem<PathFollowSystem>()); //lateSimulationSystemGroup = World.GetOrCreateSystem<LateSimulationSystemGroup>(); //applicationSystemGroup = World.GetOrCreateSystem<ApplicationSystemGroup>(); }