コード例 #1
0
    public void InstantiateCursor(int x, int y)
    {
        cursorCoords = new Utility.Coord(x, y);
        Transform cursorT
            = (Transform)Instantiate(Cursor, new Vector3(CoordXToPosition(x), 0.05f, CoordYToPosition(y)), Quaternion.Euler(Vector3.right * 90)) as Transform;

        combatControllerScript.setCursorCoords(cursorCoords);
        //Debug.Log("Cursor position is "+cursorCoords.x+" "+cursorCoords.y);

        cursor       = GameObject.Find("Cursor(Clone)");
        cursorScript = cursor.GetComponent <CursorController>();

        combatControllerScript.setCursor(cursor, cursorScript);
    }
コード例 #2
0
    void Start()
    {
        combatController       = GameObject.Find("CombatController");
        combatControllerScript = combatController.GetComponent <CombatControllerScript>();
        combatControllerScript.setMap(map, mapSize);

        GenerateMap();
        InstantiatePlayers();
        InstantiateEnemies();
        InstantiateCursor((int)mapSize.x / 2, (int)mapSize.y / 2);

        cursor       = GameObject.Find("Cursor(Clone)");
        cursorScript = cursor.GetComponent <CursorController>();

        combatControllerScript.setCursor(cursor, cursorScript);
    }