Ejemplo n.º 1
0
    private void InitializeFirstPerson()
    {
        int[] usables = new int[1]
        {
            4
        };
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(usables);
            }
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
    }
Ejemplo n.º 2
0
    private void InitializeFirstPerson()
    {
        int[] array = null;
        switch (RoomManager.Instance.WeaponOption)
        {
        case 2:
            array = new int[2]
            {
                0,
                4
            };
            break;

        case 1:
            array = new int[3]
            {
                0,
                1,
                4
            };
            break;

        default:
            array = new int[5]
            {
                0,
                2,
                1,
                3,
                4
            };
            break;
        }
        me = GameObject.Find("Me");
        if (null == me)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = me.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(array);
            }
            localController = me.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
    }
Ejemplo n.º 3
0
    private void InitializeFirstPerson()
    {
        int[] usables = new int[1]
        {
            4
        };
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(usables);
            }
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
            else
            {
                SpawnerDesc spawner = BrickManager.Instance.GetSpawner(Brick.SPAWNER_TYPE.SINGLE_SPAWNER, 0);
                if (spawner != null)
                {
                    localController.Spawn(spawner.position, Rot.ToQuaternion(spawner.rotation));
                }
                else
                {
                    localController.Spawn(BrickManager.Instance.GetRandomSpawnPos(), Rot.ToQuaternion((byte)Random.Range(0, 4)));
                }
            }
        }
    }
Ejemplo n.º 4
0
    private void InitializeFirstPerson()
    {
        int[] array        = null;
        int   weaponOption = RoomManager.Instance.WeaponOption;

        array = ((weaponOption != 3) ? new int[4]
        {
            0,
            2,
            1,
            3
        } : new int[1]);
        GameObject gameObject = GameObject.Find("Me");

        if (null == gameObject)
        {
            Debug.LogError("Fail to find Me");
        }
        else
        {
            EquipCoordinator component = gameObject.GetComponent <EquipCoordinator>();
            if (null == component)
            {
                Debug.LogError("Fail to get EquipCoordinator component for Me");
            }
            else
            {
                component.Initialize(array);
            }
            localController = gameObject.GetComponent <LocalController>();
            if (null == localController)
            {
                Debug.LogError("Fail to get LocalController component for Me");
            }
        }
    }