private void Awake()
    {
        SHLog.Debug("SHGameObjectsQualityController: initializing quality objects selection...");

        Instance = this;

        if (IsCurrentDeviceBestQuality)
        {
            SHLog.Debug("SHGameObjectsQualityController: current device is a best quality device. Removing good and normal qualities game objects.");

            SHGameObjectHelper.Destroy(GoodQualityGameObjects);
            SHGameObjectHelper.Destroy(NormalQualityGameObjects);
        }
        else
        if (IsCurrentDeviceGoodQuality)
        {
            SHLog.Debug("SHGameObjectsQualityController: current device is a good quality device. Removing best and normal qualities game objects.");

            SHGameObjectHelper.Destroy(BestQualityGameObjects);
            SHGameObjectHelper.Destroy(NormalQualityGameObjects);
        }
        else
        {
            SHLog.Debug("SHGameObjectsQualityController: current device is a normal quality device. Removing best and good qualities game objects.");

            SHGameObjectHelper.Destroy(BestQualityGameObjects);
            SHGameObjectHelper.Destroy(GoodQualityGameObjects);
        }
    }
    void Update()
    {
        if (Input.touchCount >= 3)
        {
            StringBuilder log = new StringBuilder();

            log.AppendLine("=================================");
            log.AppendLine("Skahal Studios Leak Finder Script");
            log.AppendLine("=========LOADED OBJECTS==========");
            log.AppendLine("All " + Resources.FindObjectsOfTypeAll(typeof(UnityEngine.Object)).Length);
            log.AppendLine("Textures " + Resources.FindObjectsOfTypeAll(typeof(Texture)).Length);
            log.AppendLine("AudioClips " + Resources.FindObjectsOfTypeAll(typeof(AudioClip)).Length);
            log.AppendLine("Meshes " + Resources.FindObjectsOfTypeAll(typeof(Mesh)).Length);
            log.AppendLine("Materials " + Resources.FindObjectsOfTypeAll(typeof(Material)).Length);
            log.AppendLine("GameObjects " + Resources.FindObjectsOfTypeAll(typeof(GameObject)).Length);
            log.AppendLine("Components " + Resources.FindObjectsOfTypeAll(typeof(Component)).Length);

            log.AppendLine("=========ACTIVE OBJECTS==========");
            log.AppendLine("=================================");
            log.AppendLine("All " + GameObject.FindObjectsOfType(typeof(UnityEngine.Object)).Length);
            log.AppendLine("Textures " + GameObject.FindObjectsOfType(typeof(Texture)).Length);
            log.AppendLine("AudioClips " + GameObject.FindObjectsOfType(typeof(AudioClip)).Length);
            log.AppendLine("Meshes " + GameObject.FindObjectsOfType(typeof(Mesh)).Length);
            log.AppendLine("Materials " + GameObject.FindObjectsOfType(typeof(Material)).Length);
            log.AppendLine("GameObjects " + GameObject.FindObjectsOfType(typeof(GameObject)).Length);
            log.AppendLine("Components " + GameObject.FindObjectsOfType(typeof(Component)).Length);
            SHLog.Debug(log.ToString());
        }
    }
        private IEnumerator Request(SHKeyValue keyValue, string methodName, Action <string> valueReceived = null)
        {
            var url = string.Format(CultureInfo.InvariantCulture,
                                    "{0}/services/storage/{1}.ashx?playerId={2}&key={3}&value={4}",
                                    m_serverAddress, methodName, m_playerId, keyValue.Key, keyValue.Value);

            SHLog.Debug("SHGlobalServerKeyValueStorageProvider: requesting url '{0}'.", url);

            var www = new WWW(url);

            yield return(www);

            if (String.IsNullOrEmpty(www.error))
            {
                var response = www.text;

                if (!String.IsNullOrEmpty(response))
                {
                    SHLog.Debug("SHGlobalServerKeyValueStorageProvider: response received '{0}'.", response);

                    if (valueReceived != null)
                    {
                        valueReceived(response.Replace("\"", ""));
                    }
                }
            }
            else
            {
                SettingValueFailed.Raise(this, new SHSettingValueFailedEventArgs(keyValue));
            }
        }
Esempio n. 4
0
        public virtual void Modify(TEntity entity)
        {
            var serialized = SHSerializer.SerializeToString(entity);

            var key = GetKey(entity.Id);

            SHLog.Debug("Serializing key '{0}' with raw value: '{1}'", key, serialized);
            PlayerPrefs.SetString(key, serialized);
        }
Esempio n. 5
0
        public string[] GetAllIds()
        {
            var ids = PlayerPrefs.GetString(GetAllIdsKey(), "");

            SHLog.Debug("Ids '{0}' found on {1}.", ids, GetType().Name);

            return(ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                   .Where(id => !String.IsNullOrEmpty(id.Trim()))
                   .ToArray());
        }
 void StartNight()
 {
     SHLog.Debug("DayNightControllerScript.StartNight");
     IsDay = false;
     RenderSettings.skybox       = NightSkybox;
     RenderSettings.ambientLight = NightAmbientLight;
     SHGameObjectHelper.Deactive(DayGameObjects, true);
     SHGameObjectHelper.Active(NightGameObjects, true);
     Messenger.Send("OnNightStarted");
 }
 void StartDay()
 {
     SHLog.Debug("DayNightControllerScript.StartDay");
     IsDay = true;
     RenderSettings.skybox       = DaySkybox;
     RenderSettings.ambientLight = DayAmbientLight;
     SHGameObjectHelper.Deactive(NightGameObjects, true);
     SHGameObjectHelper.Active(DayGameObjects, true);
     Messenger.Send("OnDayStarted");
 }
    private void Awake()
    {
        DontDestroyOnLoad(this);
        s_settings = Settings.ToDictionary();

        SHLog.Debug("SHConfigManager: {0} settings available.", s_settings.Count);

        foreach (var s in s_settings)
        {
            SHLog.Debug("\t{0} = {1}", s.Key, s.Value);
        }
    }
Esempio n. 9
0
    private void OnLevelWasLoaded()
    {
        foreach (var msg in m_registeredGameObjects)
        {
            var removedCount = msg.Value.RemoveAll(
                (go) => {
                return(go == null);
            });

            if (removedCount > 0)
            {
                SHLog.Debug("[Messenger] {0} GameObjects was removed from message '{1}'. {2} GameObjects remaining.", removedCount, msg.Key, msg.Value.Count);
            }
        }
    }
    /// <summary>
    /// Takes the screenshot from screen.
    /// </summary>
    public static void TakeScreenshot(Action <string> screenshotTakenCallback)
    {
        var fileName = Path.Combine(Application.persistentDataPath, "SHScreenshotHelper_TakeScreenshot.png");

        SHFileHelper.DeleteIfExists(fileName);

        ScreenCapture.CaptureScreenshot(fileName);

        SHLog.Debug("SHScreenshotHelper.TakeScreenshot: {0}", fileName);

        SHCoroutine.WaitFor(
            () =>
        {
            return(File.Exists(fileName));
        },
            () =>
        {
            screenshotTakenCallback(fileName);
        }
            );
    }
Esempio n. 11
0
    public static GameObject GetNearestFrom(GameObject from, IEnumerable <GameObject> others)
    {
        SHLog.Debug("GetNearestFrom: from = " + from.name);
        GameObject nearest        = null;
        float      lowestDistance = float.MaxValue;

        foreach (GameObject go in others)
        {
            SHLog.Debug("GetNearestFrom: go = " + go.name);

            if (go.GetInstanceID() != from.GetInstanceID())
            {
                float d = Vector3.Distance(go.transform.position, from.transform.position);

                if (d < lowestDistance)
                {
                    lowestDistance = d;
                    nearest        = go;
                }
            }
        }

        return(nearest);
    }
 /// <summary>
 /// Clear the memory.
 /// </summary>
 public static void Clear()
 {
     SHLog.Debug("SHMemoryCleaner: memory in use before cleaning: {0}", GC.GetTotalMemory(false));
     Resources.UnloadUnusedAssets();
     SHLog.Debug("SHMemoryCleaner: memory in use after cleaning: {0}", GC.GetTotalMemory(true));
 }