//TODO public void characterWasSeen() { if (!StealthManager.getInstance().isHidden()) { Debug.Log("seen!"); this.resetPositionToLastCheckpoint(); } }
//Triggered from animation public void postAnimationHide() { Instantiate(particles, transform.position, Quaternion.identity); GameManager.getInstance().scarf.enabled = false; GameManager.getInstance().body.enabled = false; GameManager.getInstance().horns.enabled = false; hideObject = (GameObject)Instantiate(hideObject, GameManager.getInstance().character.transform.position, Quaternion.identity); StealthManager.getInstance().setHidden(StealthState.HIDDEN); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); playerT = player.transform; playerSM = player.GetComponent <StealthManager> (); centrePRCTarget = GameObject.Find("PlayerRayCastTarget9"); currentAlertTime = alertTime; EnemyDetectionUI.SetActive(false); initialRotDirection = transform.rotation.eulerAngles; }
void Awake() { chancesMax = chancesLeft; for (int i = 0; i < chancesLeft; i++) { Instantiate(chance, chances); } stealthManager = gameObject.GetComponent <StealthManager> (); elapsedTime = 0.0f; audioSource = gameObject.AddComponent <AudioSource>(); audioSource.clip = backgroundMusic; audioSource.loop = true; audioSource.Play(); arrows = new KeyCode[] { KeyCode.LeftArrow, KeyCode.UpArrow, KeyCode.DownArrow, KeyCode.RightArrow }; rowNums = new KeyCode[] { KeyCode.Alpha1, KeyCode.Alpha2, KeyCode.Alpha3, KeyCode.Alpha4 }; tags = new string[] { "Note_Green", "Note_Magenta", "Note_Blue", "Note_Orange" }; columnIndexes = new List <int> () { 0, 1, 2, 3 }; foreach (Transform column in columns) { for (int i = 0; i < 10; i++) { Instantiate(blank, column); } } }
void OnTriggerStay() { if (Input.GetKeyDown(StealthManager.hideKey)) { if (StealthManager.getInstance().canHide()) { StealthManager.getInstance().hide(this.getStealthObject()); Debug.Log("Hide"); } else if (StealthManager.getInstance().canShow()) { Debug.Log("Show"); StealthManager.getInstance().show(); } } }
//TODO public void killCharacter(float t) { Debug.Log("killed!"); if (!MovementHandler.getInstance().checkIfDead()) { if (StealthManager.getInstance().isHidden()) { StealthManager.getInstance().show(); } MovementHandler.getInstance().setMovementLock(true); MovementHandler.getInstance().playDeath(); Invoke("actuallyKill", t); } }
/*-------STEALTH PROPERTIES------*/ private void Awake() { //keep the reference to pathcontroller between play/edit if (GetComponentInChildren <PathController>()) { pathParent = GetComponentInChildren <PathController>().gameObject; } DetectionLevel = 0.0f; if (manager == null) { manager = GameObject.FindObjectOfType <StealthManager>(); if (manager == null) { Debug.LogError("No stealth manager in scnene"); } } }
void Start() { self = this; hidden = StealthState.PLAINSIGHT; }
private void delayThingy() { StealthManager.getInstance().setHidden(StealthState.PLAINSIGHT); }
void Start() { self = this; hidden = StealthState.PLAINSIGHT; }