/*
 *      void CheckGameStart()
 *      {
 *              if(gameStart)
 *              {
 *                      if(first)
 *                      {
 *                              audioSource.Play();
 *                              first = false;
 *                      }
 *                      if(remainSeconds > 0f)
 *                      {
 *                              remainSeconds -= Time.deltaTime;
 *                              if(remainSeconds > 2f)
 *                              {
 *                                      text.text = "3!!!";
 *                              }else if(remainSeconds > 1f)
 *                              {
 *                                      text.text = "2!!!";
 *                              }else
 *                              {
 *                                      text.text = "1!!!";
 *                              }
 *                      }
 *                      else
 *                      {
 *                              text.text = "Game Start!";
 *                              player1Move.enabled = true;
 *                              player2Move.enabled = true;
 *                              onGame = true;
 *                              durationSeconds = 2f;
 *                      }
 *              }
 *      }
 */
    void Awake()
    {
        _instance      = this;
        playerIdentity = PlayerStatusControl_All._instance.playerIndex + 1;
        player1Move    = player1.GetComponent <PlayerMove_Level3>();
        player2Move    = player2.GetComponent <PlayerMove_Level3>();
        player3Move    = player3.GetComponent <PlayerMove_Level3>();
        player1Status  = player1.GetComponent <PlayerStatus_Level3>();
        player2Status  = player2.GetComponent <PlayerStatus_Level3>();
        player3Status  = player3.GetComponent <PlayerStatus_Level3>();
        mc             = GetComponent <MapController>();

        win_lose_black.enabled = false;

        player1Move.enabled    = false;
        player2Move.enabled    = false;
        player3Move.enabled    = false;
        remainSeconds          = 3f;
        durationSeconds        = 0;
        audioSource            = GetComponent <AudioSource>();
        win_lose_black.enabled = false;
        //tcpClient = GetComponent<TcpClient_Level3>();
        playerReady = new bool[3];
        for (int i = 0; i < 3; i++)
        {
            playerReady[i] = false;
        }
    }
 void Start()
 {
     anim         = GetComponent <Animator>();
     audioSources = GetComponents <AudioSource>();
     audioSource  = audioSources[1];
     firePosition = transform.position;
     playerStatus = GetComponent <PlayerStatus_Level3>();
 }
示例#3
0
 void Start()
 {
     player1 = GameObject.FindWithTag("Player1");
     player2 = GameObject.FindWithTag("Player2");
     player3 = GameObject.FindWithTag("Player3");
     ps1     = player1.GetComponent <PlayerStatus_Level3>();
     ps2     = player2.GetComponent <PlayerStatus_Level3>();
     ps3     = player3.GetComponent <PlayerStatus_Level3>();
 }
示例#4
0
 void Start()
 {
     anim         = GetComponent <Animator>();
     nextPosition = new Vector2(transform.position.x, transform.position.y - 1);
     nextDir      = FaceDirection.Down;
     audioSources = GetComponents <AudioSource>();
     audioSource  = audioSources[1];
     playerStatus = GetComponent <PlayerStatus_Level3>();
     playerAttack = GetComponent <PlayerAttack_Level3>();
 }
 void Start()
 {
     _instance = this;
     player1   = GameObject.FindWithTag("Player1");
     player2   = GameObject.FindWithTag("Player2");
     player3   = GameObject.FindWithTag("Player3");
     pm1       = player1.GetComponent <PlayerMove_Level3>();
     pm2       = player2.GetComponent <PlayerMove_Level3>();
     pm3       = player3.GetComponent <PlayerMove_Level3>();
     pa1       = player1.GetComponent <PlayerAttack_Level3>();
     pa2       = player2.GetComponent <PlayerAttack_Level3>();
     pa3       = player3.GetComponent <PlayerAttack_Level3>();
     ps1       = player1.GetComponent <PlayerStatus_Level3>();
     ps2       = player2.GetComponent <PlayerStatus_Level3>();
     ps3       = player3.GetComponent <PlayerStatus_Level3>();
     InitSocket();
 }
 void Update()
 {
     player1 = GameObject.FindWithTag("Player1");
     player2 = GameObject.FindWithTag("Player2");
     player3 = GameObject.FindWithTag("Player3");
     if (player1)
     {
         pm1 = player1.GetComponent <PlayerMove_Level3>();
         pa1 = player1.GetComponent <PlayerAttack_Level3>();
         ps1 = player1.GetComponent <PlayerStatus_Level3>();
     }
     if (player2)
     {
         pm2 = player2.GetComponent <PlayerMove_Level3>();
         pa2 = player2.GetComponent <PlayerAttack_Level3>();
         ps2 = player2.GetComponent <PlayerStatus_Level3>();
     }
     if (player3)
     {
         pm3 = player3.GetComponent <PlayerMove_Level3>();
         pa3 = player3.GetComponent <PlayerAttack_Level3>();
         ps3 = player3.GetComponent <PlayerStatus_Level3>();
     }
 }