public void SetVislble(bool visible) { isVisible = visible; if (isVisible) { playerVisibility = GetComponent <PlayerVisibility>(); foreach (Empire empire in empires) { playerVisibility.AddEmpire(empire); foreach (SolarSystem system in empire.GetSystems()) { if (system.GetComponent <PlayerBuildingController>().GetPlayerSpyNetwork(this)) { playerVisibility.AddObject(system.gameObject); } } } foreach (GameObject agent in agents) { playerVisibility.AddObject(agent); } foreach (PlayerBase playerBase in playerBases) { playerVisibility.AddObject(playerBase.gameObject); } } else { playerVisibility = null; } }
void Start() { player = LevelAccess.GetPlayerPos(); visibility = player.GetComponent <PlayerVisibility>(); //resetPlayerPosition = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerPos>(); //resetEnemiesPosition = GameObject.FindGameObjectsWithTag("Enemy"); gameFlowController = GameObject.FindGameObjectWithTag("GameFlowController").GetComponent <GameFlowController>(); }
void Start() { playerDetected = false; playerLocation = LevelAccess.GetPlayerPos(); playerVisibility = playerLocation.GetComponent <PlayerVisibility>(); destination = GetComponent <AIDestinationSetter>(); waitTime = startWaitTime; Init(); }
// Start is called before the first frame update void Start() { slider = transform.parent.Find("EnemyAnimator/Canvas/Slider").gameObject.GetComponent <Slider>(); player = LevelAccess.GetPlayerPos(); patrol = GetComponent <EnemyPatrol>(); visibility = player.GetComponent <PlayerVisibility>(); catchAmount = 0f; caught = false; outside = true; slider.gameObject.SetActive(false); gfc = GameObject.FindGameObjectWithTag("GameFlowController").GetComponent <GameFlowController>(); }
void Awake() { behavior = GetComponent <BehaviorTree>(); agent = GetComponent <NavMeshAgent>(); detection = GetComponent <ConeDetection>(); attack = GetComponent <EnemyAttack>(); player = GameObject.FindGameObjectWithTag("Player"); visibility = player.GetComponent <PlayerVisibility>(); GlobalVariables.Instance.SetVariableValue("Player", player); brokenEffect.SetActive(false); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { playerInRange = true; if (player == null) { feedback.text = ""; player = collision.gameObject; slider = player.transform.Find("Canvas/Slider").gameObject.GetComponent <Slider>(); playerVisibility = player.GetComponent <PlayerVisibility>(); playerMovement = player.GetComponent <PlayerMovement>(); playerCollision = player.GetComponent <Collider2D>(); } else { feedback.text = "Hold Space to Haunt"; } } }
// Start is called before the first frame update void Start() { enemy = GetComponent <EnemyConstantRotation>(); visibility = player.GetComponent <PlayerVisibility>(); }
void OnEnterPlayerVisibility(PlayerVisibility vis) { playerHasSeen = true; }
// Use this for initialization void Start() { visibility = gameObject.GetComponentInChildren <PlayerVisibility>(); health = initHealth; }
public void SetVisibilityState(PlayerVisibility visibility) { animCtrl.SetInteger("Visibility", (int)visibility); }
public void SetVisibility(PlayerVisibility visibility) { this.Visibility = visibility; animCtrl.SetVisibilityState(visibility); }
// Start is called before the first frame update void Start() { enemy = GetComponent <EnemyRandomRotation>(); visibility = player.GetComponent <PlayerVisibility>(); }
// Start is called before the first frame update void Start() { visibility = player.GetComponent <PlayerVisibility>(); }
void Awake() { instance = this; }
void OnEnterPlayerVisibility( PlayerVisibility vis ) { playerHasSeen = true; }
// Use this for initialization void Start() { visibility = gameObject.GetComponentInChildren<PlayerVisibility>(); health = initHealth; }
// Use this for initialization void Start() { m_rigidbody2d = GetComponent<Rigidbody2D>(); m_material = GetComponent<Renderer>().material; m_gamepad = GetComponent<HFTGamepad>(); visibility = gameObject.GetComponent<PlayerVisibility>(); PlayerManager.AddPlayer(this); SetChasing(PlayerManager.ShouldISeek()); int playerNumber = UnityEngine.Random.Range(0,100);//PlayerManager.NumberPlayers; SetColor(playerNumber-1); SetName(m_gamepad.Name); // Notify us if the name changes. m_gamepad.OnNameChange += ChangeName; score.catchPlayerEvent += delegate() { //visibility.StartBlinking(); //refreshName(); m_netPlayer.SendCmd("showGif", new CustomTextParcel("Tom is lazy")); }; score.caughtEvent += delegate () { //visibility.PermanentOn(); if(!justCaught) { m_netPlayer.SendCmd("showGif", new CustomTextParcel("Tom is lazy")); m_netPlayer.SendCmd("customText", new CustomTextParcel("You've been caught! Wait till next round.")); gameObject.AddComponent<PlayerStartScreen>(); PlayerManager.NumberCaught++; Debug.Log("So far caught: " + PlayerManager.NumberCaught); //See if the game ends! if (PlayerManager.NumberHiding == PlayerManager.NumberCaught) { RoundManager.Instance.EndGame(true); //seekers win } justCaught = true; } }; //refreshName(); }