/// <summary> /// Does all the initialization that cannot be done when the instance is being created. /// (Controllers may need Game to be initialized already which needs instances of players) /// </summary> public void Init(PlacementController placerNetwork, MoveController moveController, KillController killController, FlyingController flyingController) { this.placerNetwork = placerNetwork; this.moveController = moveController; this.killController = killController; this.flyingController = flyingController; }
void Start() { playerChooser = GameObject.Find("Player").transform.FindChild("Trigger").GetComponent<TriggerChooser>(); SacrificeCircle = GameObject.Find("Player").GetComponent<CharController>().SATAN; SacrificeCircle.SetActive(true); killCounter = GameObject.Find("KillCounter").GetComponent<KillController>(); }
// Update is called once per frame void Update() { //Debug.Log(killController.canKill); if (killController == null) { if (monster == null) { monster = GameObject.FindGameObjectWithTag("Monster"); } else if (monster != null) { killController = monster.GetComponent <KillController>(); animator = monster.GetComponent <Animator>(); } } if (outline.enabled == true && Input.GetKeyDown("e") && !hidden && !hide) { if (killController != null && Vector3.Distance(player.transform.position, monster.transform.position) < killDistance) { killController.canKill = true; } else if (killController != null) { killController.canKill = false; } lastPosition = player.transform.position; hide = true; playerController.isHidden = true; } else if (outline.enabled == false && hidden && Input.GetKeyDown("e") && hide) { if (killController != null) { killController.canKill = true; } hide = false; playerController.isHidden = false; } if (hide && !hidden) { //player.GetComponent<CharacterController>().SimpleMove(Vector3.zero); StartCoroutine(hidePlayer()); } else if (!hide && hidden) { StartCoroutine(unhidePlayer()); } else if (hidden && monster != null && animator.GetBool("kill") == true) { StartCoroutine(unhidePlayer()); gameObject.SetActive(false); } }
// Start is called before the first frame update void Start() { outline = gameObject.GetComponent <Outline>(); player = GameObject.Find("Player"); playerController = player.GetComponent <PlayerController>(); cam = GameObject.FindGameObjectWithTag("MainCamera"); monster = GameObject.FindGameObjectWithTag("Monster"); if (monster != null) { killController = monster.GetComponent <KillController>(); animator = monster.GetComponent <Animator>(); } }
private void OnTick(object sender, EventArgs e) { // Process menus UIController.Update(); KillController.Update(); VehicleController.Update(); BlipController.Update(); UIController.TimerBarPool.Draw(); if (CameraController.CurrentCamera != null) { //DebugInfo.Bar1.Text = Math.Round(CameraManager.CurrentCamera.Rotation.X, 2).ToString() + ", " + Math.Round(CameraManager.CurrentCamera.Rotation.Y, 2).ToString() + ", " + Math.Round(CameraManager.CurrentCamera.Rotation.Z, 2).ToString(); //DebugInfo.Bar2.Text = Math.Round(CameraManager.CurrentCamera.Position.X, 2).ToString() + ", " + Math.Round(CameraManager.CurrentCamera.Position.Y, 2).ToString() + ", " + Math.Round(CameraManager.CurrentCamera.Position.Z, 2).ToString(); } }
void Start() { player = GameObject.Find("Player"); elevator = GameObject.Find("Elevator"); killCounter = GameObject.Find("KillCounter").GetComponent<KillController>(); }