vp_FPSShooter.Awake C# (CSharp) Method

Awake() public method

public Awake ( ) : void
return void
    void Awake()
    {
        m_Camera = transform.root.GetComponentInChildren<vp_FPSCamera>();
        if (m_Camera == null)
        {
            Debug.LogError("Camera is null.");
            return;
        }

        // instantiate muzzleflash
        if (MuzzleFlashPrefab != null)
        {
            m_MuzzleFlash = (GameObject)Object.Instantiate(MuzzleFlashPrefab,
                                                            m_Camera.transform.position,
                                                            m_Camera.transform.rotation);
            m_MuzzleFlash.name = transform.name + "MuzzleFlash";
            m_MuzzleFlash.transform.parent = m_Camera.transform;
        }

        RefreshSettings();
    }