コード例 #1
0
        /// <summary>
        /// Static initializer
        /// </summary>
        public static FpsCounterScript Init(UIFont font)
        {
            GameObject       gameObj = new GameObject();
            FpsCounterScript script  = gameObj.AddComponent <FpsCounterScript>();

            script.Setup(font);
            return(script);
        }
コード例 #2
0
ファイル: SceneScript.cs プロジェクト: praveen1091/Beats2
        /// <summary>
        /// Called on during creation
        /// </summary>
        public virtual void Start()
        {
            // Add a background image
            Texture2D testBackground = Loader.LoadTexture(@"Z:\SkyDrive\Development\Workspace\trunk\beats2n\Assets\Resources\Common\Game\Background.jpg", false);

            background = BackgroundScript.Init(Display.centre, testBackground, Display.height);

            // Add an FPS counter
            UIFont uiFont = UITools.CreateFont(testFont, 30);

            fpsCounter = FpsCounterScript.Init(uiFont);
        }