示例#1
0
 public void IsEnableObjects(bool value)
 {
     AIplayer.transform.GetComponent <Rigidbody>().useGravity    = value;
     AIplayer.GetComponent <PandaBehaviour>().enabled            = value;
     ball.transform.GetComponent <Rigidbody>().useGravity        = value;
     humanPlayer.transform.GetComponent <Rigidbody>().useGravity = value;
 }
示例#2
0
    IEnumerator Wait()
    {
        yield return(new WaitForSeconds(2));

        GoalUI.SetActive(false);
        isPauseGame = false;
        AIplayer.GetComponent <PandaBehaviour>().enabled = true;
    }
示例#3
0
    public void GoalEntered()
    {
        isPauseGame = true;
        AIplayer.GetComponent <PandaBehaviour>().enabled = false;
        GoalUI.SetActive(true);
        StartCoroutine(Wait()); //wait 1 seconds

        AI_player.BackToInitPosition();
        humanPlayer.BackToInitPosition();
        Debug.Log("AI_player init pos= " + humanPlayer.GetPos());

        ballController.GoalEntered();
        current_time = TURN_TIMER;
    }
示例#4
0
    public void OnTargetFound()
    {
        isMarkerDetected = true;
        isTimerOn        = true;
        scanBarcodeContainer.SetActive(false);
        timerUiContainer.SetActive(true);
        scoreUi.SetActive(true);
        joystick.SetActive(true);
        menuGameUiContainer.SetActive(true);
        gameObjectsContainer.SetActive(true);
        isPauseGame = false;


        string HumanPlayerAvatar = NetworkClient.users[NetworkClient.clientID].avatar;

        avatar.DisplayAvatar(humanPlayerAvatar, HumanPlayerAvatar);
        avatar.DisplayAvatar(aiPlayerAvatar, Avatar.AI_AVATAR);

        if (level == 1)
        {
            AI_player = GameObject.FindObjectOfType <AIPlayerLevel1>();
        }
        else if (level == 2)
        {
            AI_player = GameObject.FindObjectOfType <AIPlayerLevel2>();
        }
        GameObject[] g = GameObject.FindGameObjectsWithTag("BlockPlane");
        foreach (GameObject obj in g)
        {
            MeshRenderer mesh = obj.GetComponent <MeshRenderer>();
            mesh.enabled = false;
        }
        AIplayer.GetComponent <PandaBehaviour>().enabled = false;
        ballController = GameObject.FindObjectOfType <BallController>();
        if (isTimerFinish && !isGameOver)
        {
            IsEnableObjects(true);
        }
    }