summaryrefslogtreecommitdiff
path: root/Runtime/Misc/BuildSettings.h
blob: ed8f1168a23da0d7c03f6f3d6ffde703968dd750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once

#include "Runtime/BaseClasses/GameManager.h"
#include "Runtime/Utilities/vector_map.h"

class BuildSettings : public GlobalGameManager
{
	public:

	REGISTER_DERIVED_CLASS (BuildSettings, GlobalGameManager)
	DECLARE_OBJECT_SERIALIZE (BuildSettings)

	BuildSettings (MemLabelId label, ObjectCreationMode mode);

	std::vector<UnityStr>    levels;
	std::vector<UnityStr>    remappedLevels;
	typedef vector_map<int, UInt32> ClassHashCont;
	ClassHashCont            runtimeClassHashes;

	bool                     hasRenderTexture;
	bool                     hasPROVersion;
	bool					 hasAdvancedVersion; // PRO version for the active platform.
	bool					 enableDynamicBatching;

	bool                     isNoWatermarkBuild;
	bool                     isPrototypingBuild;
	bool                     isEducationalBuild;
	bool                     isEmbedded;
	bool                     hasPublishingRights;
	bool                     hasShadows;
	bool                     hasSoftShadows;
	bool                     hasLocalLightShadows;
	bool                     isDebugBuild;
	bool					 usesOnMouseEvents;

	UnityStr                 m_AuthToken;

	virtual void AwakeFromLoad (AwakeFromLoadMode awakeMode);

	std::string GetLevelPathName (int index);
	std::string GetLevelPathName (const std::string& name);
	string GetLevelName (int index);

	int GetLevelIndex (const std::string& name);
	int GetLevelIndexChecked (const string& name);

	int GetIntVersion () { return m_IntVersion; }
	const UnityStr& GetVersion () { return m_Version; }

	UInt32 GetHashOfClass (int classID) const;

	private:

	int                     m_IntVersion;
	UnityStr                m_Version;
};

BuildSettings& GetBuildSettings();
BuildSettings* GetBuildSettingsPtr();

extern int kUnityVersion3_2_a1;
extern int kUnityVersion3_3_a1;
extern int kUnityVersion3_4_a1;
extern int kUnityVersion3_5_a1;
extern int kUnityVersion3_5_3_a1;
extern int kUnityVersion4_0_a1;
extern int kUnityVersion4_1_a1;
extern int kUnityVersion4_1_a3;
extern int kUnityVersion4_1_1_a1;
extern int kUnityVersion4_2_a1;
extern int kUnityVersion4_3_a1;
extern int kUnityVersion_OldWebResourcesAdded;

// The NaCl runtime will always be included with the player files,
// so in practice the version will always match.
#if !WEBPLUG || (UNITY_NACL && !UNITY_NACL_WEBPLAYER)
#define IS_CONTENT_NEWER_OR_SAME(val) true
#else
#define IS_CONTENT_NEWER_OR_SAME(val) (GetBuildSettingsPtr() && GetBuildSettings().GetIntVersion() >= val)
#endif