コード例 #1
0
    void Start()
    {
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        panelCenter = canvasObj.GetComponent <PanelCenter> ();
        showScore();
        showImg();
    }
コード例 #2
0
ファイル: GameOverState.cs プロジェクト: iChant/FruitNinja
 public override void enter()
 {
     Debug.Log("GameOverState enter!");
     pc = PanelCenter.Instance;
     //scoreBoard = ScoreBoard.Instance;
     //scoreBoard.SetScoreList(score);
     pc.showGameOverPanel();
 }
コード例 #3
0
    // Use this for initialization
    void Start()
    {
        kinectManager = KinectManager.Instance;
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        canvas          = canvasObj.GetComponent <Canvas>();
        panelCenter     = canvasObj.GetComponent <PanelCenter>();
        menuAudioSource = GetComponent <AudioSource>();
    }
コード例 #4
0
ファイル: Test.cs プロジェクト: mengtest/FruitNinja
    // Use this for initialization
    void Start()
    {
        createFruit();
        gameOverImg.gameObject.SetActive(false);
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        //canvas = canvasObj.GetComponent<Canvas> ();
        panelCenter = canvasObj.GetComponent <PanelCenter> ();
        sound       = gameObject.GetComponent <AudioSource> ();
    }
コード例 #5
0
 void Start()
 {
     canvasObj = gameObject;
     EntityManager.Instance.registerEntity(canvasObj, EntityType.CanvasEntity);
     instance     = this;
     stateMachine = gameObject.GetComponent <StateMachine> ();
     stateMachine.currentState = FirstPanelState.Instance;
     stateMachine.currentState.enter();
     stateMachine.previousState = null;
 }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        kinectManager = KinectManager.Instance;
        gameOverImg.gameObject.SetActive(false);
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        panelCenter = canvasObj.GetComponent <PanelCenter>();
        startAudio.Play();
        createFruit();
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        canvas                   = canvasObj.GetComponent <Canvas> ();
        panelCenter              = canvasObj.GetComponent <PanelCenter> ();
        imageToUserMap           = canvasObj.GetComponent <ImageToUserMap> ();
        imageToUserMap.kinectImg = kinectImg;
        sound      = gameObject.GetComponent <AudioSource> ();
        sound.clip = menu;
        sound.Play();
    }
コード例 #8
0
ファイル: GameRule.cs プロジェクト: mengtest/FruitNinja
    //AudioSource sound;//声音**

    /* 1.产生多个水果
     * 2.gameover图片不显示
     * 3.获取canvas
     * 4.获取canvas中的Panelcenter组件
     * 5.获取声音**
     */
    void Start()
    {
        createMultiTrail();
        createMulFruit();
        //gameOverImg.gameObject.SetActive (false);
        GameObject canvasObj = GameObject.FindWithTag("Canvas");

        lifeControl = Instantiate(lifeSemaphoreColone, lifeSemaphoreColone.position, lifeSemaphoreColone.rotation) as RectTransform;
        lifeControl.SetParent(transform);
        //canvas = canvasObj.GetComponent<Canvas> ();
        panelCenter = canvasObj.GetComponent <PanelCenter> ();
        //sound = gameObject.GetComponent<AudioSource> ();//**
    }
コード例 #9
0
 public override void Focus()
 {
     if (PanelCenter.CanFocus)
     {
         PanelCenter.Focus();
     }
     else if (PanelLeft.CanFocus)
     {
         PanelLeft.Focus();
     }
     else if (!PanelRight.CanFocus)
     {
         PanelRight.Focus();
     }
     else
     {
         PanelBottom.Focus();
     }
 }
コード例 #10
0
 public override void enter()
 {
     pc = PanelCenter.Instance;
     pc.showGamePanel();
 }
コード例 #11
0
 public static void Open()
 {
     PanelCenter.PickFromSelected();
 }
コード例 #12
0
        public override void OnLayout(IGUIContext ctx, RectangleF bounds)
        {
            base.OnLayout(ctx, bounds);

            SplitterLeft.Visible   = PanelLeft.Visible && (PanelCenter.Visible || PanelBottom.Visible);
            SplitterRight.Visible  = PanelRight.Visible && PanelCenter.Visible;
            SplitterBottom.Visible = PanelBottom.Visible && (PanelCenter.Visible || PanelRight.Visible);

            if (SplitterLeft.Visible)
            {
                SplitterLeft.OnLayout(ctx, bounds);
            }
            if (SplitterRight.Visible)
            {
                SplitterRight.OnLayout(ctx, bounds);
            }
            if (SplitterBottom.Visible)
            {
                SplitterBottom.OnLayout(ctx, bounds);
            }


            //if (!PanelLeftCollapsed)
            //	SplitterLeft.OnLayout (ctx, this.Bounds);
            /******/
            if (!PanelBottomCollapsed && !PanelCenterCollapsed)
            {
                float left = bounds.Left;
                if (!PanelLeftCollapsed && SplitterLeft.Visible)
                {
                    left = SplitterLeft.Right;
                }
                SplitterBottom.OnLayout(ctx, new RectangleF(left, Top, Width - left, Height - SplitterBottom.Bottom));
            }
            if (!PanelRightCollapsed)
            {
                float bottom = bounds.Bottom;
                if (!PanelBottomCollapsed && SplitterBottom.Visible)
                {
                    bottom = SplitterBottom.Top;
                }
                SplitterRight.OnLayout(ctx, new RectangleF(SplitterRight.Left, Top, SplitterRight.Width, Height - bottom));
            }



            // dump splitters

            /***
             * this.LogDebug("SplitterLeft.Left: {0}", SplitterLeft.Left);
             * this.LogDebug("SplitterBottom.Top: {0}", SplitterBottom.Top);
             * this.LogDebug("SplitterRight.Right: {0}", SplitterRight.Right);
             ***/

            // it's nice to handle such things quite optimized..

            if (PanelLeft.Visible)
            {
                PanelLeft.OnLayout(ctx, new RectangleF(Left, Top, SplitterLeft.Left - Left, Height));
            }
            if (PanelCenter.Visible)
            {
                float left   = bounds.Left;
                float right  = bounds.Right;
                float bottom = bounds.Bottom;
                if (!PanelLeftCollapsed && SplitterLeft.Visible)
                {
                    left = SplitterLeft.Right;
                }
                if (!PanelRightCollapsed && SplitterRight.Visible)
                {
                    right = SplitterRight.Left;
                }
                if (!PanelBottomCollapsed && SplitterBottom.Visible)
                {
                    bottom = SplitterBottom.Top;
                }
                PanelCenter.OnLayout(ctx, new RectangleF(left, Top, right - left, bottom - Top));
            }
            if (PanelBottom.Visible)
            {
                float left = bounds.Left;
                if (!PanelLeftCollapsed && SplitterLeft.Visible)
                {
                    left = SplitterLeft.Right;
                }
                PanelBottom.OnLayout(ctx, new RectangleF(left, SplitterBottom.Bottom, Right - left, Bottom - SplitterBottom.Bottom));
            }
            if (PanelRight.Visible)
            {
                float bottom = bounds.Bottom;
                if (!PanelBottomCollapsed && SplitterBottom.Visible)
                {
                    bottom = SplitterBottom.Top;
                }
                PanelRight.OnLayout(ctx, new RectangleF(SplitterRight.Right, Top, Right - SplitterRight.Right, Height - bottom));
            }
        }