public void FoundGhost() { Debug.Log("Found a ghost!"); CanvasPlayerUIObject.transform.Find("GhunterCaughtGhost").gameObject.SetActive(true); WinLoseScript MainWinLoseScript = GameObject.Find("EventSystem").GetComponent <WinLoseScript>(); MainWinLoseScript.WinGhunter("FoundGhosts"); }
// Update is called once per frame void Update() { if (enemiesRemaining <= 0) { WinLoseScript wlScript = (WinLoseScript)WinLose.GetComponent(typeof(WinLoseScript)); wlScript.Win(); } }
// Use this for initialization void Start() { levelManagement = FindObjectOfType <LevelManagement>(); gaurdMovement = FindObjectOfType <GaurdMovement>(); FollowCursor = FindObjectOfType <followCursor>(); winLose = FindObjectOfType <WinLoseScript>(); carried = FindObjectOfType <Carried>(); speed = moveSpeed; }
// Update is called once per frame void Update() { //dies if (health <= 0 && alive) { WinLoseScript wlScript = (WinLoseScript)winLose.GetComponent(typeof(WinLoseScript)); wlScript.Lose(); alive = false; health--; AimTowardMouse aimer = (AimTowardMouse)GetComponent(typeof(AimTowardMouse)); MovePlayer mover = (MovePlayer)GetComponent(typeof(MovePlayer)); Shoot shooter = (Shoot)bulletEmitter.GetComponent(typeof(Shoot)); aimer.kill(); mover.kill(); shooter.kill(); GameObject tempRD = Instantiate(ragdoll, transform.position, transform.rotation); PlayerRagdollHandler rHandler = (PlayerRagdollHandler)tempRD.GetComponent(typeof(PlayerRagdollHandler)); rHandler.pushRagdoll(pushValue); Destroy(gameObject); } }
private void Start() { winLoseScript = GetComponent <WinLoseScript>(); myOwnCollider = GetComponent <BoxCollider>(); }
// Start is called before the first frame update void Start() { wlref = GameObject.Find("winTrigger").GetComponent <WinLoseScript>(); }
void Start() { //mySPR = GetComponent<SpriteRenderer>(); endGame = GameObject.FindGameObjectWithTag("WinLose").GetComponent <WinLoseScript>();; }
// Start is called before the first frame update void Start() { StartCoroutine(CountDown()); MainWinLoseScript = GameObject.Find("EventSystem").GetComponent <WinLoseScript>(); }