Exemplo n.º 1
0
    public tnCameraSetDescriptor GetCameraSet(string i_CameraSetId)
    {
        tnCameraSetDescriptor camerSet = null;

        m_CamerasSets.TryGetValue(i_CameraSetId, out camerSet);
        return(camerSet);
    }
Exemplo n.º 2
0
    public tnCamerasSet(tnCameraSetDescriptor i_Descriptor)
    {
        m_Cameras = new Dictionary <int, GameObject>();

        if (i_Descriptor != null)
        {
            foreach (string id in i_Descriptor.keys)
            {
                GameObject camera = i_Descriptor.GetCamera(id);

                if (camera == null)
                {
                    continue;
                }

                int hash = StringUtils.GetHashCode(id);
                m_Cameras.Add(hash, camera);
            }
        }
    }
Exemplo n.º 3
0
    // LOGIC

    public void Initialize(string i_DatabasePath)
    {
        tnCamerasDatabase database = Resources.Load <tnCamerasDatabase>(i_DatabasePath);

        if (database != null)
        {
            foreach (string id in database.keys)
            {
                tnCameraSetDescriptor cameraSetDescriptor = database.GetCameraSet(id);
                if (cameraSetDescriptor != null)
                {
                    int hash = StringUtils.GetHashCode(id);

                    tnCamerasSet cameraSet = new tnCamerasSet(cameraSetDescriptor);
                    m_Data.Add(hash, cameraSet);
                }
            }
        }
        else
        {
            LogManager.LogWarning(this, "Database not loaded.");
        }
    }