Esempio n. 1
0
    float spf         = 0.033f;//30fps

    public void Start()
    {
        NativeInterface.Init();
        ShaderMgr.Init();
        ui_sty.normal.textColor = Color.red;
        ui_sty.fontSize         = 20;
    }
Esempio n. 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 3
0
        public void Dispose()
        {
            GC.SuppressFinalize(this);

            if (frontBuffer != null)
            {
                frontBuffer.Dispose();
                frontBuffer = null;
            }
            if (FrameBuffer != null)
            {
                FrameBuffer.Dispose();
                FrameBuffer = null;
            }
            if (Rasterizer != null)
            {
                Rasterizer.Dispose();
                Rasterizer = null;
            }
            if (ShaderData != null)
            {
                ShaderData.Dispose();
                ShaderData = null;
            }
            if (ShaderMgr != null)
            {
                ShaderMgr.Dispose();
                ShaderMgr = null;
            }

            Shader         = null;
            UsingSubShader = null;
            UsingPass      = null;
        }
Esempio n. 4
0
 public override void PostLoad()
 {
     base.PostLoad();
     if (m_equip == null || m_equip.skin == null || tex == null)
     {
         return;
     }
     m_equip.mpb.SetTexture(ShaderMgr.GetPartOffset(part), tex);
     m_equip.skin.SetPropertyBlock(m_equip.mpb);
 }
Esempio n. 5
0
        private void InitShaders()
        {
            m_ShaderMgr = new SharpDXShaderMgr(this);

            m_DefaultPixelShader  = (SharpDXShader)ShaderMgr.LoadPS("Content/Shaders/Default.ps.hlsl");
            m_DefaultVertexShader = (SharpDXShader)ShaderMgr.LoadVS("Content/Shaders/Default.vs.hlsl");

            PixelShader  = m_DefaultPixelShader;
            VertexShader = m_DefaultVertexShader;
        }
Esempio n. 6
0
    public static void Init(MonoBehaviour en)
    {
        _entrance = en;
        Application.targetFrameRate = 60;
#if Native
        NativeInterface.Init();
#endif
        XTimerMgr.singleton.Init();
        XConfig.Initial(LogLevel.Log, LogLevel.Error);
        XGlobalConfig.Initial();
        XTableMgr.Initial();
        ShaderMgr.Init();
        XResources.Init();
        UIManager.singleton.Initial();
        Documents.singleton.Initial();
        RegistCallbackLog();
    }
Esempio n. 7
0
        //  --- Unity default ---
        // Use this for initialization
        void Awake()
        {
            if (null == instance)
            {
                instance = this;
            }
            else if (this != instance)
            {
                Destroy(gameObject);
            }

            DontDestroyOnLoad(gameObject);

            InitGame();
            //get instance of managers
            sceneManager   = GetComponent <SceneMgr>();
            shaderManager  = GetComponent <ShaderMgr>();
            messageManager = GetComponent <MessageMgr>();
            ItemManager    = GetComponent <ItemMgr>();
        }