Пример #1
0
    private void SpawnPlayer(int a_id, int a_inputdir = 0)
    {
        GameObject gameObject = (GameObject)Object.Instantiate(position: new Vector3(Random.Range((0f - m_radius) * 0.8f, m_radius * 0.8f), 1f, Random.Range((0f - m_radius) * 0.8f, m_radius * 0.8f)), original: m_playerPrefab, rotation: Quaternion.identity);
        FakePlayer component  = gameObject.GetComponent <FakePlayer>();

        component.m_id = a_id;
        component.SetInput(a_inputdir);
    }
Пример #2
0
    private void SpawnPlayer(int a_id, int a_inputdir = 0)
    {
        Vector3    position   = new Vector3(UnityEngine.Random.Range(-this.m_radius * 0.8f, this.m_radius * 0.8f), 1f, UnityEngine.Random.Range(-this.m_radius * 0.8f, this.m_radius * 0.8f));
        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(this.m_playerPrefab, position, Quaternion.identity);
        FakePlayer component  = gameObject.GetComponent <FakePlayer>();

        component.m_id = a_id;
        component.SetInput(a_inputdir);
    }