Example #1
0
        private void ReleaseBindings()
        {
#if !SDL2 && !MONOGAME
            CurrentNativeBinding = default(NativeBinding);
#endif
            // TODO: Should we invalidate the compatibility binding here? I don't think that needs to happen
        }
Example #2
0
        private void CreateNativeBinding(out NativeBinding result)
        {
            var pUnboxedEffect = Effect.GetUnboxedID3DXEffect();

            result = default(NativeBinding);

            var pGetParameterByName = COMUtils.GetMethodFromVTable <DGetParameterByName>(
                pUnboxedEffect, KnownMethodSlots.GetParameterByName
                );

            var hParameter = pGetParameterByName(pUnboxedEffect, null, Name);

            if (hParameter == null)
            {
                throw new Exception("Could not find d3dx parameter for uniform " + Name);
            }

            var layout = new Layout(Type, pUnboxedEffect, hParameter);

            result = new NativeBinding {
                pUnboxedEffect = pUnboxedEffect,
                hParameter     = hParameter,
                Fixups         = layout.Fixups,
                UploadSize     = layout.UploadSize
            };

            result.pSetRawValue = COMUtils.GetMethodFromVTable <DSetRawValue>(result.pUnboxedEffect, KnownMethodSlots.SetRawValue);

            result.IsValid = true;
        }
Example #3
0
        private void Log(string _tagName, object _message, eConsoleLogType _logType, UnityEngine.Object _context, int _skipStackFrameCount = 1)
        {
            // Do I need to ignore this call
            if (IgnoreConsoleLog(_tagName))
            {
                return;
            }

            // Add additional skip frame
            _skipStackFrameCount++;

            int _tagID = GetIndexOfConsoleTag(_tagName);

            // When we cant find our tag, add a new entry
            if (_tagID == -1)
            {
                m_consoleTags.Add(new ConsoleTag(_tagName));

                // And update tag-ID
                _tagID = m_consoleTags.Count - 1;
            }

            ConsoleTag _consoleLogTag = m_consoleTags[_tagID];

            // Marked to ignore this log
            if (_consoleLogTag.Ignore)
            {
                return;
            }

            int        _logID         = m_consoleLogsList.Count + 1;
            ConsoleLog _newConsoleLog = new ConsoleLog(_logID, _tagID, _message.ToString(), _logType, _context, _skipStackFrameCount);

#if UNITY_EDITOR
            // Add this new console to list of logs
            m_consoleLogsList.Add(_newConsoleLog);

            // Add it to display list
            bool _addSuccess = AddToDisplayableLogList(_newConsoleLog);

            if (_addSuccess)
            {
                // Pause unity player on error
                if (_logType != eConsoleLogType.INFO && _logType != eConsoleLogType.WARNING)
                {
                    if (m_errorPause)
                    {
                        EditorApplication.isPaused = true;
                    }
                }
            }

            // Set as modified
            EditorUtility.SetDirty(this);
#else
            NativeBinding.Log(_newConsoleLog);
#endif
        }
Example #4
0
        public void CheckPushON()
        {
#if UNITY_IOS && !UNITY_EDITOR
            if (!NativeBinding.IsPushOn())
            {
                PopupsText.Me.PushOnMessage();
            }
#endif
        }
Example #5
0
    void OnApplicationPause(bool pauseStatus)
    {
        if (!pauseStatus)
        {
            AddLog("Resumed");
#if UNITY_IOS && !UNITY_EDITOR
            var urlString = NativeBinding.OnOpenURLListener_GetOpenURLString();
            AddLog(string.Format("GetOpenURLString: [{0}]", urlString));
#endif
        }
    }
Example #6
0
        private void GetCurrentNativeBinding(out NativeBinding nativeBinding)
        {
            lock (Lock) {
                if (!CurrentNativeBinding.IsValid)
                {
                    IsDirty = true;
                    CreateNativeBinding(out CurrentNativeBinding);
                }

                nativeBinding = CurrentNativeBinding;
            }
        }
Example #7
0
 public IPublicKey GetPublicKey()
 {
     return(NativeBinding.GetPublicKeyFromPrivate(Bytes));
 }