void Start()
    {
        _shouldSpeak = true;
        _projSpawned = false;

        _CB       = GetComponent <CharacterBehaviour>();
        _animator = GetComponent <Animator>();

        _charging = false;

        if (!_camController)
        {
            // Debug.LogWarning("No CameraController reference in inspector. Looking up object.");
            _camController = Camera.main.GetComponent <CameraController>();
        }
        if (!_projectilePrefab)
        {
            Debug.LogError("No prefab for projectile");
        }
        if (!_projectileSpawn)
        {
            Debug.LogError("No spawnpoint for projectile");
        }
        // if (!_coolDown)
        // {
        //     // Debug.LogWarning("No CoolDown reference in inspector. Looking up object.");
        //     _coolDown = GameObject.Find("CoolDownProj").GetComponent<CoolDown>();
        // }
        /** Check to see if there is an OnPlayerHUD */
        if (!_onPlayerHUD)
        {
            _onPlayerHUD = GetComponent <OnPlayerHUD>();
        }
    }
Beispiel #2
0
    void Start()
    {
        _animator = GetComponent <Animator>();

        if (_maxDiameter <= 0.0f)
        {
            Debug.LogError("The value for xray radius is too low. Make sure it is more than 0.0f");
        }
        if (_speed <= 0.0f)
        {
            Debug.LogError("The value for xray speed is too low. Make sure it is more than 0.0f");
        }
        if (!_cameraTransform)
        {
            _cameraTransform = Camera.main.transform;
        }

        //seting default values
        _orb.localScale = Vector3.zero;
        _orb.GetComponent <Collider>().isTrigger = true;
        _currentDiameter = 0.0f;
        _xraySearching   = false;
        _canXray         = true;

        if (!_onPlayerHUD)
        {
            _onPlayerHUD = GetComponent <OnPlayerHUD>();
        }
    }
    // Use this for initialization
    void Start()
    {
        // make sure there is a teleport point in the scene
        if (!_teleportPoint)
        {
            Debug.Log("No Teleport Point Prefab added to Player.");
            _teleportPoint = GameObject.Find("TeleportPoint");
        }
        // make sure there is a Player Shadow in the scene
        if (!_fakePlayer)
        {
            Debug.Log("No player shadow prefab added to scene.");
            _fakePlayer = GameObject.Find("PlayerShadow");
        }
        // make sure there is a teleport radius in the scene
        if (!_radius)
        {
            Debug.Log("No teleport radius added to scene");
            _radius = GameObject.Find("TeleportRadius");
        }
        /** Check for OnPlayerHUD */
        if (!_onPlayerHUD)
        {
            _onPlayerHUD = GetComponent <OnPlayerHUD>();
        }

        if (!_mainCam)
        {
            _mainCam = Camera.main.GetComponent <CameraController>();
        }

        if (!_charBehaviourScript)
        {
            _charBehaviourScript = gameObject.GetComponent <CharacterControllerScheme>();
        }
        if (!_characterBehaviour)
        {
            _characterBehaviour = GetComponent <CharacterBehaviour>();
        }

        if (!_teleportPointRenderer)
        {
            _fakePlayer.SetActive(true);
            _teleportPointRenderer = GetComponentInChildren <MeshRenderer>();
            _fakePlayer.SetActive(false);
        }
        if (!_teleportParticleSystem)
        {
            _fakePlayer.SetActive(true);
            _teleportParticleSystem = GetComponentInChildren <ParticleSystem>();
            _fakePlayer.SetActive(false);
        }

        _rb         = gameObject.GetComponent <Rigidbody>();
        _anim       = gameObject.GetComponent <Animator>();
        _mainCamera = Camera.main;

        // initializing variables
        _isCooled = true;
        _isActive = false;
    }