Example #1
0
        public void AddType(RuntimePlatform platform, string tag, Type platformSpecificType)
        {
            CrossPlatformType crossPlatformType = new CrossPlatformType(platform, tag);

            m_platformTypeMap.Add(crossPlatformType, platformSpecificType);
            Logger.LogInfo(this, "Platform added = " + crossPlatformType.ToString() + " type = " + platformSpecificType.ToString());
        }
Example #2
0
            public override bool Equals(object obj)
            {
                if (obj == null || GetType() != obj.GetType())
                {
                    return(false);
                }
                CrossPlatformType crossPlatformType = obj as CrossPlatformType;

                return(m_platform == crossPlatformType.m_platform && m_tag == crossPlatformType.m_tag);
            }
Example #3
0
        public Type GetTypeForCurrentPlatform()
        {
            string tag = "";

            if (!m_ignorePlatformTags)
            {
                tag = EnvironmentManager.GetPlatformTag();
            }
            CrossPlatformType platform = new CrossPlatformType(Application.platform, tag);

            return(GetType(platform));
        }
Example #4
0
        public Type GetType(CrossPlatformType platform)
        {
            if (m_platformTypeMap.ContainsKey(platform))
            {
                return(m_platformTypeMap[platform]);
            }
            CrossPlatformType key = new CrossPlatformType(platform.Platform, "");

            if (m_platformTypeMap.ContainsKey(key))
            {
                return(m_platformTypeMap[key]);
            }
            return(m_defaultType);
        }
Example #5
0
        public Type GetType(RuntimePlatform platform)
        {
            if (platform != Application.platform)
            {
                Logger.LogFatal(this, "Calling CrossPlatformInitAction::GetType() with platform != Application.platform may return wrong type.");
            }
            else
            {
                Logger.LogWarning(this, "Type CrossPlatformInitAction::GetType(RuntimePlatform platform) is obsolete now, please use GetTypeForCurrentPlatform()");
            }
            string tag = "";

            if (!m_ignorePlatformTags)
            {
                tag = EnvironmentManager.GetPlatformTag();
            }
            CrossPlatformType platform2 = new CrossPlatformType(platform, tag);

            return(GetType(platform2));
        }