示例#1
0
    public override void loadLevel()
    {
        swipeControl = gameObject.AddComponent("newSwipe_Levels") as newSwipe_Levels;

        setMainVars();

        swipeControl.setUpSwipeLimits(2, true);
        ships = script.playerVersion;


        string  newProp;
        Vector3 newScale;
        Vector3 newPosition;
        Vector3 newRotation;

        if (script.gameSetting == 1)
        {
            buildingProps = "Buildings/SpaceHangar";
            newProp       = buildingProps;
            newScale      = new Vector3(5, 10, 5);
            newPosition   = new Vector3(0, 0, -125);
            newRotation   = new Vector3(90, 180, 0);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }
        else
        {
            buildingProps = "Buildings/Planetarium";
            newProp       = buildingProps;
            newScale      = new Vector3(2.9f, 4.2f, 2.9f);
            newPosition   = new Vector3(0, 0, -125);
            newRotation   = new Vector3(90, 180, 0);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }

        for (int i = 0; i < 2; i++)
        {
            newProp     = ships[i];
            newScale    = new Vector3(10, 10, 10);
            newPosition = new Vector3(-23, 0, 50);
            newRotation = new Vector3(90, 0, 0);
            createGoodsObject(newProp, newScale, newPosition, newRotation, props[0].transform.FindChild("buyableObjectSpawn").transform);
            buyableObjects[i].GetComponent <Spaceship_Player>().shipInitialization();
            if (i == shipSelected)
            {
                buyableObjects[i].SetActive(true);
            }
            else
            {
                buyableObjects[i].SetActive(false);
            }
        }


        newProp     = "SunLight";
        newScale    = new Vector3(1, 1, 1);
        newPosition = new Vector3(0, 15, -15);
        newRotation = new Vector3(125, 0, 0);
        createDirectionalLightInScene(newProp, newScale, newPosition, newRotation,
                                      background.transform, Color.white);


        completed = false;
        hasShip   = false;

        for (int i = 0; i < script.hangar.shipTypes.Count; i++)
        {
            if (ships[shipSelected] == script.hangar.shipTypes[i])
            {
                hasShip = true;
                shipPos = i;
            }
        }

        if (startTime == "")
        {
            startTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
    public override void loadLevel()
    {
        swipeControl = gameObject.AddComponent("newSwipe_Levels") as newSwipe_Levels;

        setMainVars();

        swipeControl.setUpSwipeLimits(6, true);

        canons = script.playerArmory;

        string  newProp;
        Vector3 newScale;
        Vector3 newPosition;
        Vector3 newRotation;

        if (script.gameSetting == 1)
        {
            buildingProp = "Buildings/Gunshop";
            newProp      = buildingProp;
            newScale     = new Vector3(10, 10, 10);
            newPosition  = new Vector3(0, -50, -54);
            newRotation  = new Vector3(0, 270, 270);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }
        else
        {
            buildingProp = "Buildings/Kihoskh";
            newProp      = buildingProp;
            newScale     = new Vector3(10, 10, 10);
            newPosition  = new Vector3(0, -50, -125);
            newRotation  = new Vector3(0, 270, 270);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }


        for (int i = 0; i < 6; i++)
        {
            newProp     = canons[i];
            newScale    = new Vector3(15, 15, 15);
            newPosition = new Vector3(0, 0, 50);
            newRotation = new Vector3(75, 0, 0);
            createGoodsObject(newProp, newScale, newPosition, newRotation, props[0].transform.FindChild("buyableObjectSpawn").transform);
            float objHeight = buyableObjects[i].transform.localScale.x;
            Debug.Log(i);
            buyableObjects[i].GetComponent <Weapons_Base>().forceStart();
            if (i == canonSelected)
            {
                buyableObjects[i].SetActive(true);
            }
            else
            {
                buyableObjects[i].SetActive(false);
            }
        }

        completed = false;
        hasGun    = false;

        for (int i = 0; i < script.hangar.canonTypes.Count; i++)
        {
            if (canons[canonSelected] == script.hangar.canonTypes[i])
            {
                hasGun = true;
                gunPos = i;
            }
        }


        newProp     = "SunLight";
        newScale    = new Vector3(1, 1, 1);
        newPosition = new Vector3(0, 15, -15);
        newRotation = new Vector3(125, 0, 0);
        createDirectionalLightInScene(newProp, newScale, newPosition, newRotation,
                                      background.transform, Color.white);

        if (startTime == "")
        {
            startTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            Debug.Log(startTime);
        }
    }
    public override void loadLevel()
    {
        swipeControl = gameObject.AddComponent("newSwipe_Levels") as newSwipe_Levels;
        // finds the texture for the buttons
        setMainVars();
        countMountOne = GameObject.Find("ARCamera").GetComponent <Player_Charactor>().hangar.mount1Set;
        countMountTwo = GameObject.Find("ARCamera").GetComponent <Player_Charactor>().hangar.mount2Set;
        swipeControl.setUpSwipeLimits(script.hangar.hangarslots.Count, true);

        completed = false;

        string  newProp;
        Vector3 newScale;
        Vector3 newPosition;
        Vector3 newRotation;

        if (script.gameSetting == 1)
        {
            buildingProps = "Buildings/SpaceHangar";
            newProp       = buildingProps;
            newScale      = new Vector3(5, 10, 5);
            newPosition   = new Vector3(0, 0, -125);
            newRotation   = new Vector3(90, 180, 0);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }
        else
        {
            buildingProps = "Buildings/Planetarium";
            newProp       = buildingProps;
            newScale      = new Vector3(2.9f, 4.2f, 2.9f);
            newPosition   = new Vector3(0, 0, -125);
            newRotation   = new Vector3(90, 180, 0);
            createScaleSceneObject(newProp, newScale, newPosition, newRotation, background.transform);
        }



        newScale    = new Vector3(10, 10, 10);
        newPosition = new Vector3(-23, 0, 50);
        newRotation = new Vector3(0, 0, 0);


        for (int i = 0; i < script.hangar.hangarslots.Count; i++)
        {
            if (i == script.shipChoise)
            {
                createPlayerSpaceship(script.hangar.hangarslots[i], newScale, newPosition, newRotation, props[0].transform.FindChild("buyableObjectSpawn").transform, false, true);
            }
            else
            {
                createPlayerSpaceship(script.hangar.hangarslots[i], newScale, newPosition, newRotation, props[0].transform.FindChild("buyableObjectSpawn").transform, false, false);
            }
        }


        newProp     = "SunLight";
        newScale    = new Vector3(1, 1, 1);
        newPosition = new Vector3(0, 15, -15);
        newRotation = new Vector3(125, 0, 0);
        createDirectionalLightInScene(newProp, newScale, newPosition, newRotation,
                                      background.transform, Color.white);

        shipScript = script.hangar.hangarslots[script.shipChoise].GetComponent <Spaceship_Player>();
        swipeControl.resetSwipe(script.shipChoise);
    }