Example #1
0
    void Start()
    {
        GameObject gamePanelObj = EntityManager.Instance.getEntityFromId(Singleton.gameType);

        gameRule = gamePanelObj.GetComponent <Game2Rule> ();
        sound    = gamePanelObj.GetComponent <AudioSource> ();
    }
Example #2
0
 void Start()
 {
     instance     = this;
     canvasObj    = GameObject.FindWithTag("Canvas");
     stateMachine = gameObject.GetComponent <StateMachine> ();
     stateMachine.currentState = GameBeginState.Instance;
     stateMachine.currentState.enter();
     stateMachine.previousState = null;
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        //GameObject canvasObj = GameObject.FindWithTag("Canvas");
        GameObject gamePanelObj   = GameObject.FindWithTag("Game2");
        GameObject lifeControlObj = GameObject.FindWithTag("LifeControl");

        //lifeNumControl = lifeControlObj.GetComponent<LifeNumControl> ();
        scoreControl = lifeControlObj.GetComponent <ScoreControl> ();
        timeControl  = lifeControlObj.GetComponent <TimeNumControl> ();
        //canvas = canvasObj.GetComponent<Canvas> ();
        gameRule = gamePanelObj.GetComponent <Game2Rule> ();
        sound    = gamePanelObj.GetComponent <AudioSource> ();
    }
Example #4
0
 public override void enter()
 {
     gameRule = Game2Rule.Instance;
     if (Singleton.gameType == EntityType.TimeGamePanelEntity)
     {
         timeControl             = TimeControl.Instance;
         timeControl.isGameStart = true;
         MessageDispatcher.Instance.dispatchMessage(60.0f, EntityType.TimeGamePanelEntity, MessageType.Msg_GameOver, new Vector2(0, 0), 0);
         MessageDispatcher.Instance.dispatchMessage(56.0f, EntityType.TimeGamePanelEntity, MessageType.Msg_AlmostOver, new Vector2(0, 0), 0);
     }
     else
     {
         lifeControl = LifeContent.Instance;
     }
     scoreControl = ScoreControl.Instance;
     InvokeRepeating("generateFruits", 0.0f, 3.0f);
 }
Example #5
0
 public override void enter()
 {
     imageToUserMap = GameObject.FindWithTag("Canvas").GetComponent <ImageToUserMap> ();
     gameRule       = Game2Rule.Instance;
     if (Singleton.gameType == EntityType.TimeGamePanelEntity)
     {
         MessageDispatcher.Instance.dispatchMessage(3.0f, EntityType.TimeGamePanelEntity, MessageType.Msg_GameStart, new Vector2(0, 0), 0);
     }
     else
     {
         MessageDispatcher.Instance.dispatchMessage(3.0f, EntityType.LifeGamePanelEntity, MessageType.Msg_GameStart, new Vector2(0, 0), 0);
     }
     imageToUserMap.kinectImg = gameRule.kinectImg;
     initIfFirstHandPos();
     createMultiTrail();
     createMultiCollider();
     gameStartShow();
 }