Ejemplo n.º 1
0
    static int UnInitialize(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MapCameraControl obj = LuaScriptMgr.GetNetObject <MapCameraControl>(L, 1);

        obj.UnInitialize();
        return(0);
    }
Ejemplo n.º 2
0
    void Start()
    {
        mapCameraControl = GetComponent <MapCameraControl>();

        Input.compass.enabled = true;

        InitCreateObjects();
    }
Ejemplo n.º 3
0
    static int Create(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            MapCameraControl obj = new MapCameraControl();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: MapCameraControl.New");
        }

        return(0);
    }
Ejemplo n.º 4
0
    public MapLabel parentalLabel;    //used for threading a route through elevators

    //bool addedToMapping = false;

    // Use this for initialization
    void Start()
    {
        mapLabels[this.Id] = this;

        //load the components
        textMesh = this.gameObject.GetComponent("TextMesh") as TextMesh;
        marker   = this.transform.FindChild("Marker").gameObject;
        //guiText = this.transform.guiText;

        //change the text to what is should be
        textMesh.text = label;
        checkVisible();
        //guiText.text = label;
        this.name = "Label (" + label + ")";

        //guiText.pixelOffset = new Vector2(Screen.width/2, Screen.height/2);

        //make the text non-fuzzy
        float pixelRatio = (Camera.main.orthographicSize * 2) / Camera.main.pixelHeight;

        //float characterSize = 1f;
        transform.localScale = new Vector3(pixelRatio * 10f, pixelRatio * 10f, pixelRatio * 0.1f);

        marker.transform.localScale = new Vector3(1f, 1f, 4f) / (pixelRatio * 10f);



        //check if you're supposed to display this one
        if (priority <= 1)
        {
            this.GetComponent <Renderer>().enabled = false;
            this.transform.GetChild(0).GetComponent <Renderer>().enabled = false;
        }

        //make sure the world know this label exists
        pathLocation = /*MapMaker.ActiveFloor.closestUnnocupiedTo*/ (transform.position);
        pathLocation = new Vector3(pathLocation.x, pathLocation.y, 0f);
        id           = MapCameraControl.addLabel(this);

        scanSelf();
    }
Ejemplo n.º 5
0
    void Start()
    {
        LoadLocationNames();
        background = GameObject.Find ("MapScreenBackground");
        if (!background) Debug.Log("Can't find map background");
        InputRepeater repeater = background.AddComponent<InputRepeater>();
        repeater.SetTarget(transform);

        GameObject cameraControlObj = GameObject.Find ("CameraPivot");
        cameraControl = cameraControlObj.GetComponent<MapCameraControl>();
        cameraControl.SetUp(this);
        if (!cameraControl) Debug.Log("Can't find map camera");

        GameObject gameControlObj = GameObject.Find ("GameControl");
        gameControl = gameControlObj.GetComponent<GameControl>();
        if (!gameControl) Debug.Log("Can't find GameControl");

        Random.seed = gameControl.GetGameMapSeed();

        GameObject point = null;
        if (interval < 1) {
            Debug.Log("Inverval too low");
            return;
        }
        int zOffset = 0;
        for (int x = 0; x < width; x += interval) {
            if (zOffset == 0) {
                zOffset = 1;
            } else {
                zOffset = 0;
            }
            for (int z = zOffset; z < length; z += interval) {
                if (Random.value < density) {
                    point = Instantiate(dotPrefab, Vector3.zero, Quaternion.identity) as GameObject;
                    point.transform.name = "Point-" + x + "-" + z;
                    Vector3 randomOffset = new Vector3(Random.Range(-0.25f, 0.25f), 0, Random.Range(-0.25f, 0.25f));
                    Vector3 centerOffset = new Vector3(-(float) width * 0.5f, 0, -(float)length * 0.5f);
                    point.transform.parent = transform;
                    point.transform.localPosition = new Vector3(x, 0, z) + randomOffset + centerOffset;
                    point.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
                    points.Add(point.transform);
                }
            }
        }
        point.renderer.sharedMaterial.renderQueue = 3100;
        CreatePlayerBase();
        CreateEnemyBase();
        ConnectBases();
        SetUpConnections();
        SetSpecialNodes();

        string nextStep = gameControl.currentLevel.Equals("Menu") ? "MapIntro" : "AddResults";

        Invoke (nextStep, 2);

        portraitThief = GameObject.Find ("MapScreenThief").transform;
        portraitThief.animation.Play("Intro");
        Invoke ("playPortraitLoop", portraitThief.animation["Intro"].length);
    }