// Use this for initialization void Start() { dogC = dog.GetComponent <DogControls> (); doorC = door.GetComponent <ItemInteraction> (); elevatorC = elevator.GetComponent <ItemInteraction> (); cameraC = camera.GetComponent <LightSoundControl> (); }
// Use this for initialization void Start() { direction = 1; isDead = false; initialSpeed = 6f; initialDogAngle = 45f; initialDogDistance = 5f; attentionSpan = 2f; attentionCountdown = -1f; speed = initialSpeed; myRb = GetComponent <Rigidbody> (); myRb.freezeRotation = true; //myRend = GetComponent<Renderer> (); if (myType == 0) { health = 2; } else if (myType == 1) { health = 1; } nearDog = false; dogC = dog.GetComponent <DogControls> (); attackCD = 1f; hitSound = GetComponent <AudioSource> (); }
// Update is called once per frame void Update() { RaycastHit rh; Vector3 eyePosition = transform.position + Vector3.up * 0.666f; Vector3 dogDirection = dog.transform.position - eyePosition; if (seesDog) { nearestEnemy = dog.GetComponent <DogControls> (); nearestEnemy.beginCutScene = true; if (nearestEnemy.enterNewRoom) { SceneManager.LoadScene("Basic Maze"); } } else { dogAngle = initialDogAngle; dogDistance = initialDogDistance; if (Vector3.Angle(dogDirection, Vector3.right * direction + Vector3.down) < dogAngle) { if (Physics.Raycast(eyePosition, dogDirection.normalized * dogDistance, out rh, dogDistance, ~(1 << LayerMask.NameToLayer("Interactable")))) { if (rh.collider.tag == "Dog") { //Debug.Log ("Begin Dialogue"); seesDog = true; } } } } }
void beginCutScene() { //message = guiText.text; textbox.GetComponent <Text>().text = ""; StartCoroutine(TypeText()); seesDog = false; nearestEnemy = dog.GetComponent <DogControls> (); nearestEnemy.beginCutScene = true; dialogueStart = true; }
// Use this for initialization void Start() { if (infoObj == null) { infoObj = GameObject.Find("PlayerInfo"); } infoObj = GameObject.Find("PlayerInfo"); myInfo = infoObj.GetComponent <PlayerInfo> (); anim = GetComponent <Animator>(); timesincelastattack = 0f; direction = 1; isDead = false; initialSpeed = 5f; initialDogAngle = 90; initialviewDistance = 10f; attentionSpan = 5f; attentionCountdown = -1f; speed = initialSpeed; myRb = GetComponent <Rigidbody> (); myRb.freezeRotation = true; //myRend = GetComponent<Renderer> (); if (myType == 0) { health = 5; } else if (myType == 1) { health = 1; } nearDog = false; dogC = dog.GetComponent <DogControls> (); attackCD = 1f; //Debug.Log("Interaction"+num); // notice = GameObject.Find("Interaction"+num); hitSound = GetComponent <AudioSource> (); ////Debug.Log(notice); // notice.GetComponent<MeshRenderer>().enabled = false; focusDirection = new Vector3(direction, -0.9f, 0f); coneQuality = 1; timesincelastblock = 0f; timesincelastjump = 0f; mesh = GetComponentInChildren <MeshFilter>().mesh; meshRenderer = GetComponentInChildren <MeshRenderer>(); meshRenderer.material = materials[0]; timesincedeath = 0f; }
// Use this for initialization void Start() { //Debug.Log(RenderSettings.ambientLight.b); RenderSettings.ambientLight = new Color(ogRed, 0f, ogBlue, 0f); aSources = gameObject.GetComponents <AudioSource>(); fight_music = aSources[0]; default_music = aSources[1]; boss_dialogue_music = aSources[2]; boss_fight_music = aSources[3]; dogC = dog.GetComponent <DogControls> (); aSources[0].volume = 0f; aSources[2].volume = 0f; aSources[3].volume = 0f; }
// Use this for initialization void Start() { dogC = dog.GetComponent <DogControls> (); lineRenderer = GetComponent <LineRenderer>(); lineRenderer.SetWidth(laserWidth, laserWidth); //lineRenderer.SetColor(color, color); //lineRenderer.SetPosition(0, transform.position); myTransform = transform; offset = new Vector3(0, 0, 0); //lineRenderer.SetPosition(1, offset); hitSound = GetComponent <AudioSource> (); //endEffect = GetComponentInChildren<ParticleSystem>(); //if(endEffect) // endEffectTransform = endEffect.transform; attackCD = 1f; }
// Use this for initialization void Start() { dogC = dog.GetComponent <DogControls> (); }
// Use this for initialization void Start() { originalPosition = transform.position; dogC = dog.GetComponent <DogControls> (); }