Пример #1
0
    private void PlaceObjects()
    {
        Vector3 position;

        // A couple of test cubes
        if (PlayspaceManager.Instance.TryPlaceOnFloor(out position, cubePrefab.transform.localScale))
        {
            Instantiate(cubePrefab, position, Quaternion.identity);
        }
        if (PlayspaceManager.Instance.TryPlaceOnPlatform(out position, 0.25f, 1.5f, cubePrefab.transform.localScale.x))
        {
            Instantiate(cubePrefab, position + cubePrefab.transform.localScale.y * Vector3.up, Quaternion.identity);
        }

        // Chibi-robot!
        for (int i = 0; i < 3; i++)
        {
            if (PlayspaceManager.Instance.TryPlaceOnPlatform(out position, 0.25f, 1.5f, 0.25f))
            {
                GameObject      bomb  = Instantiate(bombPrefab);
                GameObject      obj   = Instantiate(robotPrefab, position, Quaternion.identity);
                RobotController robot = obj.GetComponent <RobotController>();
                robot.AddBomb(bomb);
            }
        }
    }