Exemplo n.º 1
0
 void Awake()
 {
     _controllerScript = _controller.GetComponent <FirstPersonAIO>();
     Cursor.lockState  = CursorLockMode.Locked;
     Cursor.visible    = false;
     _audioManager     = FindObjectOfType <AudioManager>();
 }
    private void SaveObjectColor()
    {
        // create a dictionary and save unique instance id and color
        Object[]  _allGameObjects = FindObjectsOfType <GameObject>();
        Stopwatch _calc           = new Stopwatch();

        _calc.Start();
        foreach (GameObject obj in _allGameObjects)
        {
            FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>();
            MeshRenderer   _hasMeshRenderer     = obj?.GetComponent <MeshRenderer>();
            Ignore         _hasIgnoreComponent  = obj?.GetComponent <Ignore>();
            if (_hasControllerScript == null)
            {
                if (_hasMeshRenderer != null && _hasIgnoreComponent == null)
                {
                    Renderer _checkColor = obj?.GetComponent <Renderer>();
                    _storedObjects.Add(obj);
                    _redColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.r);
                    _greenColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.g);
                    _blueColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.b);
                }
            }
        }
        _calc.Stop();

        string elapsedTime = string.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                           _calc.Elapsed.Hours, _calc.Elapsed.Minutes, _calc.Elapsed.Seconds,
                                           _calc.Elapsed.Milliseconds / 10);

        UnityEngine.Debug.Log(elapsedTime);
    }
Exemplo n.º 3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            if (_hasOnlyAudio)
            {
                _audioSource.Play();
                StartCoroutine(RemoveScript(_audioSource.clip.length));
            }
            else if (_hasCutScene)
            {
                _director.Play();
                StartCoroutine(RemoveScript((float)_director.duration));
            }
            else if (_death)
            {
                _uiManager.Dead();
            }

            if (_freezPlayer)
            {
                _player = other.GetComponent <FirstPersonAIO>();
                _player.playerCanMove = false;
            }
        }
    }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     player  = GameObject.FindGameObjectWithTag("Player");
     arms    = GameObject.FindGameObjectWithTag("Arms");
     script  = player.GetComponent <FirstPersonAIO>();
     script2 = player.GetComponent <PlayerInfo>();
 }
Exemplo n.º 5
0
 void OnTriggerEnter(Collider weapon)
 {
     if (weapon.gameObject.CompareTag("Machete"))
     {
         Debug.Log("Player is dead");
         isDead       = true;
         DeathTrigger = true;
         CapsuleCollider collider = gameObject.GetComponent <CapsuleCollider>();
         collider.direction = 2;
         FirstPersonAIO player = gameObject.GetComponent <FirstPersonAIO>();
         player.enabled = false;
         rainDrops.SetActive(false);
         bloodDrops.SetActive(true);
         knifeObj.SetActive(false);
     }
     else if (weapon.gameObject.CompareTag("AK_Bullet"))
     {
         Debug.Log("Player is dead");
         isDead       = true;
         DeathTrigger = true;
     }
     else if (weapon.gameObject.CompareTag("Shell_Round"))
     {
         Debug.Log("Player is dead");
         isDead       = true;
         DeathTrigger = true;
     }
     else
     {
         return;
     }
 }
Exemplo n.º 6
0
 void Awake()
 {
     _internal = this;
     button.gameObject.SetActive(false);
     scrollRect.gameObject.SetActive(false);
     hero = GameObject.Find("Hero").GetComponent <FirstPersonAIO>();
 }
 private void Awake()
 {
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible   = false;
     _readingGuide    = FindObjectOfType <ReadingGuide>();
     _cameraReference = FindObjectOfType <FirstPersonAIO>();
     _readingGuide.gameObject.SetActive(false);
 }
 void Start()
 {
     MinTime          = 5f;
     MaxTime          = 10f;
     player           = GameObject.FindGameObjectWithTag("Player");
     playerhead       = player.GetComponentInChildren <AudioListener>().transform.parent;
     playerController = player.GetComponentInParent <FirstPersonAIO>();
 }
Exemplo n.º 9
0
    public void setSensitivity()
    {
        if (player == null)
        {
            player = GameObject.Find("FirstPerson-AIO").GetComponent <FirstPersonAIO>();
        }

        player.mouseSensitivity = sensitivitySlider.value + 1;
    }
Exemplo n.º 10
0
 private void Start()
 {
     detection    = GetComponent <PlayerEnemyInteraction>();
     capsule      = GetComponent <CapsuleCollider>();
     groundNormal = Vector3.one;
     audioSource  = GetComponent <AudioSource>();
     firstPerson  = GetComponent <FirstPersonAIO>();
     playerRB     = GetComponent <Rigidbody>();
 }
Exemplo n.º 11
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         FirstPersonAIO player = other.GetComponent <FirstPersonAIO>();
         player.advanced.gravityMultiplier = 1f;
         //player.IsInWater = false;
     }
 }
Exemplo n.º 12
0
 private void Start()
 {
     buttonE             = InGameAssetManager.i.buttonE;
     inventory           = InGameAssetManager.i.inventory;
     isFlashLightOpening = InGameAssetManager.i.flashLight.enabled;
     AIO = GetComponent <FirstPersonAIO>();
     inventoryBGColor = new Color(0, 0, 0, 0);
     InGameAssetManager.i.inventoryBG.color = inventoryBGColor;
     playerState = GetComponent <PlayerDying>();
 }
Exemplo n.º 13
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            FirstPersonAIO player = other.GetComponent <FirstPersonAIO>();
            player.advanced.gravityMultiplier = 0.7f;
            //player.IsInWater = true;

            _audioSource.Play();
        }
    }
Exemplo n.º 14
0
 void Start()
 {
     playerUnder          = false;
     interact             = GameObject.Find("GameUI").transform.GetChild(0).GetComponent <TextMeshProUGUI>();
     coll                 = GetComponent <BoxCollider>();
     defaultRotationAngle = transform.localEulerAngles.x;
     currentRotationAngle = transform.localEulerAngles.x;
     closedSize           = coll.size;
     closedCenter         = coll.center;
     source               = GetComponent <AudioSource>();
     firstPersonScript    = GameObject.FindGameObjectWithTag("Player").GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 15
0
    void Start()
    {
        player         = FindObjectOfType <FirstPersonAIO>();
        playerObjManip = player.GetComponent <ObjectManipulation>();
        HeadJoint      = GameObject.Find("HeadJoint").transform;

        currentLevel   = 0;
        currentSection = 0;

        player.transform.position    = levels[0].initPos;
        player.transform.eulerAngles = levels[0].initRot;
        HeadJoint.eulerAngles        = levels[0].initRot;
    }
Exemplo n.º 16
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Transform Tag is: " + cameraTwo.tag);
        Debug.Log("Transform Tag is: " + cameraOne.tag);
        FirstPersonAIO1 = GameObject.Find("PinkGirl").GetComponent <FirstPersonAIO>();
        FirstPersonAIO2 = GameObject.Find("CowBoy").GetComponent <FirstPersonAIO>();

        //Get Camera Listeners
        cameraOneAudioLis = cameraOne.GetComponent <AudioListener>();
        cameraTwoAudioLis = cameraTwo.GetComponent <AudioListener>();

        //Camera Position Set
        cameraPositionChange(PlayerPrefs.GetInt("CameraPosition"));
    }
Exemplo n.º 17
0
    // Start is called before the first frame update
    void Start()
    {
        agent                = GetComponent <NavMeshAgent>();
        anim                 = GetComponent <Animator>();
        player               = GameObject.FindGameObjectWithTag("Player").transform;
        agent.speed          = 1.2f;
        BossRb               = GetComponent <Rigidbody>();
        PlayerRb             = player.GetComponent <Rigidbody>();
        agent.updateRotation = false;
        capsule              = player.GetComponent <CapsuleCollider>();
        StartCoroutine(playGruntSound());
        firstPerson          = player.GetComponent <FirstPersonAIO>();
        agent.updateRotation = true;

        previousPos = transform.position;
    }
Exemplo n.º 18
0
    private void Start()
    {
        if (!FindObjectOfType <SoundManager>().isPlaying("Music"))
        {
            FindObjectOfType <SoundManager>().PlayFade("Music");
        }

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
        numberOfCards    = 0;
        currentHealth    = maxHealth;
        objectiveScript  = objective.GetComponent <Objectives>();
        firstScript      = GetComponent <FirstPersonAIO>();
        firstScript.concreteFootSteps = concreteFootSteps;
        firstScript.grassFootSteps    = grassFootSteps;
        firstScript.woodFootSteps     = woodFootSteps;


        Invoke("escapeNotify", 5f);
    }
Exemplo n.º 19
0
 private void ResaturateObjects()
 {
     Object[] _allObjects = FindObjectsOfType <GameObject>();
     foreach (GameObject obj in _allObjects)
     {
         FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>();
         MeshRenderer   _hasMeshRenderer     = obj?.GetComponent <MeshRenderer>();
         Ignore         _hasIgnoreScript     = obj?.GetComponent <Ignore>();
         Renderer       _objRenderer         = obj?.GetComponent <Renderer>();
         if (_hasControllerScript == null)
         {
             if (_hasIgnoreScript == null)
             {
                 if (_hasMeshRenderer != null && _objRenderer != null)
                 {
                     _objRenderer.material.color = ResaturateColors(_objRenderer);
                 }
             }
         }
     }
 }
Exemplo n.º 20
0
 private void SaveObjectColor()
 {
     // create a dictionary and save unique instance id and color
     Object[] _allGameObjects = FindObjectsOfType <GameObject>();
     foreach (GameObject obj in _allGameObjects)
     {
         FirstPersonAIO _hasControllerScript = obj?.GetComponent <FirstPersonAIO>();
         MeshRenderer   _hasMeshRenderer     = obj?.GetComponent <MeshRenderer>();
         Ignore         _hasIgnoreComponent  = obj?.GetComponent <Ignore>();
         if (_hasControllerScript == null)
         {
             if (_hasMeshRenderer != null && _hasIgnoreComponent == null)
             {
                 Renderer _checkColor = obj?.GetComponent <Renderer>();
                 _storedObjects.Add(obj);
                 _redColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.r);
                 _greenColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.g);
                 _blueColorValues.Add(obj.GetInstanceID(), _checkColor.material.color.b);
             }
         }
     }
 }
Exemplo n.º 21
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            _cam.SetActive(true);

            _playerBehaviour                      = other.GetComponent <FirstPersonAIO>();
            _playerBehaviour.Targetable           = false;
            _playerBehaviour.playerCanMove        = false;
            _playerBehaviour.lockAndHideCursor    = false;
            _playerBehaviour.enableCameraMovement = false;
            Rigidbody rb = _playerBehaviour.gameObject.GetComponent <Rigidbody>();
            _playerBehaviour.enabled = false;
            rb.velocity   = Vector3.zero;
            rb.useGravity = false;

            Cursor.visible   = false;
            Cursor.lockState = CursorLockMode.Locked;

            StartCoroutine(EnableMouse(110));
            _director.Play();
        }
    }
Exemplo n.º 22
0
 private void Awake()
 {
     camScript = GetComponent <FirstPersonAIO>();
     //holdPosition = CenterRay().GetPoint(1f);
 }
Exemplo n.º 23
0
 void Start()
 {
     moveContr = GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 24
0
// Awake is a built-in unity function that is called called only once during the lifetime of the script instance.
// It is called after all objects are initialized.
// For more info, see:
    void Awake()
    {
        rb          = GetComponent <Rigidbody>();
        firstPerson = GetComponent <FirstPersonAIO>();
        SetMaxVelocity(maxVelocity);
    }
Exemplo n.º 25
0
 void Start()
 {
     firstPerson = GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 26
0
 // Start is called before the first frame update
 void Start()
 {
     text = GetComponent <Text>();
     hero = GameObject.Find("Hero").GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 27
0
 private void Awake()
 {
     _playerScript = PlayerObject?.GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 28
0
    private void UpdatePlayerState(Collider other, bool state)
    {
        FirstPersonAIO player = other.GetComponent <FirstPersonAIO>();

        player.Targetable = state;
    }
Exemplo n.º 29
0
 private void Awake()
 {
     _controllerSettings = _controller.GetComponent <FirstPersonAIO>();
 }
Exemplo n.º 30
0
 private void Awake()
 {
     _controllerSettings = _controller.GetComponent <FirstPersonAIO>();
     _audioManager       = FindObjectOfType <AudioManager>();
 }