Пример #1
0
 private void initialize()
 {
     inputManager = new KeyInputManager("minigame");
     maxErrors    = keyList.Length / 5;
     duration     = defaultDuration * keyList.Length;
     start();
 }
Пример #2
0
    void Start()
    {
        _input = GameObject.FindGameObjectWithTag("Input").GetComponent <KeyInputManager>();

        _goHandler = GameObject.FindGameObjectWithTag("Handler").GetComponent <GameObjectHandler>();
        _goHandler.InsertObject(GameObject.FindGameObjectWithTag("Player"), "Player");
        _goHandler.InsertObject(GameObject.FindGameObjectWithTag("Cpu"), "Cpu");

        _goHandler.InsertObject(ballPref, "Ball");
        Instantiate <GameObject>(_goHandler.ReceiveObject("Ball"), new Vector3(0, 0, 0), Quaternion.identity);


        GameObject.FindGameObjectWithTag("Ball").GetComponent <Ball>().OnDeath += SpawnBall;

        _input.AddDelicate(MoveTheBall, "Start", KeyInputManager.keyInputType.OnHold);
        _input.AddDelicate(_goHandler.ReceiveObject("Player").GetComponent <PongBar>().MoveUp, "Up", KeyInputManager.keyInputType.OnHold);
        _input.AddDelicate(_goHandler.ReceiveObject("Player").GetComponent <PongBar>().MoveDown, "Down", KeyInputManager.keyInputType.OnHold);
    }
Пример #3
0
    private void Start()
    {
        isActivate     = false;
        isHandlingFile = false;
        localIP        = null;
        IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());

        foreach (IPAddress ip in host.AddressList)
        {
            if (ip.AddressFamily == AddressFamily.InterNetwork)
            {
                localIP = ip.ToString();
                break;
            }
        }
        Debug.Log("hostIP : " + localIP);
        KeyInputManager keyInputManager = GameObject.Find("KeyInputManager").GetComponent <KeyInputManager>();

        keyInputManager.EV_escape += EndServer;
    }
Пример #4
0
    // Start is called before the first frame update
    void Start()
    {
        isActivate = false;
        localIP    = null;
        IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());

        inputAddress = "";
        inputMessage = "";

        foreach (IPAddress ip in host.AddressList)
        {
            if (ip.AddressFamily == AddressFamily.InterNetwork)
            {
                localIP = ip.ToString();
                break;
            }
        }
        Debug.Log("Client IP : " + localIP);
        clientUIManager.ShowClientInfo("Client IP : " + localIP);
        KeyInputManager keyInputManager = GameObject.Find("KeyInputManager").GetComponent <KeyInputManager>();

        keyInputManager.EV_escape += EndConnect;
    }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        KeyInputManager keyInputManager = GameObject.Find("KeyInputManager").GetComponent <KeyInputManager>();

        keyInputManager.EV_escape += OnEscape;
    }
Пример #6
0
    void Awake()
    {
        instance = this;
        print(ot);
        if(ot)
        {
            p1_stocks = 1;
            p2_stocks = 1;
        }
        else
        {
            p1_stocks = MatchSettingsData.stock_total;
            p2_stocks = MatchSettingsData.stock_total;
        }
        countdown = MatchSettingsData.match_time + 1;
        p1Left.text = p1_stocks.ToString();
        p2Left.text = p2_stocks.ToString();

        inptmng = GameObject.Find("InputManager");
        keyinpt = inptmng.GetComponent<KeyInputManager>();
        continpt = inptmng.GetComponent<ControllerInputManager>();
        sfxmng = GameObject.Find("SoundManager").GetComponent<SFXManager>();
        if(MatchSettingsData.mstrinptmng == "Keys")
        {
            continpt.enabled = false;
            keyinpt.enabled = true;
            primaryINPT = keyinpt;
            keys = true;
        }
        else
        {
            continpt.enabled = true;
            keyinpt.enabled = false;
            primaryINPT = continpt;
            keys = false;
        }
        stats = GameObject.Find("StatsManager").GetComponent<StatsManager>();

        P1.setTag("P1");
        P1.transform.position = P1spawnPoint.position;
        p1_origin = Instantiate(P1);//clone P1
        p1_origin.enabled = false;
        p1_origin.transform.position = new Vector3(-425.5f, 245, 0);
        //p1_origin.rend.enabled = false;

        P2.setTag("P2");
        P2.transform.position = P2spawnPoint.position;
        p2_origin = Instantiate(P2);//clone P2
        p2_origin.enabled = false;
        p2_origin.transform.position = new Vector3(-431.5f, 245, 0);

        pauseMenu.SetActive(false);
        primaryINPT.lockcontrols();
    }