Ejemplo n.º 1
0
    public List <Vector3> movementArray;   // = new List<Vector3>();



    void Awake()
    {
        wasGenerated  = false;
        _wasRender    = false;
        _timeFindPath = 0;

        //s
        GameObject pObj_;

        pObj_        = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent <JTSScene0>();


        movementArray = new List <Vector3>();


        AStar.OnPathFinded += HandleAStarOnPathFinded;

        _gridTransforms   = new List <List <Transform> >();
        _nodeStatesGrid   = new List <List <TileController> >();
        _parentTransforms = new List <Transform>();

        _numRows = int.Parse(_numRowsString);
        _numCols = int.Parse(_numColsString);

        _camera = Camera.main;

        // ROOT PARENT just for BEAUTY STRUCTURE
        GameObject go = new GameObject("GRID_MAP_NODES");

        _parentTransform = go.transform;
    }
Ejemplo n.º 2
0
    private List <Vector3> movementArray;   // = new List<Vector3>();

    // Use this for initialization
    void Start()
    {
        if (unitDiag == false)
        {
            moveRangeDiag = moveRangeLR - (moveRangeLR - 1);
        }
        else
        {
            moveRangeDiag = moveRangeLR;
        }

        rayHitPoint = new Vector3(0.0f, 0.0f, 0.0f);
        onTileIndex = 0;        //maybe scan tile array at start ?
        //renderer.material.color = new Color( 1 , 1 , 1 , 0.5f );
        gameObject.AddComponent("InputInterface");

        //matchController = GameObject.Find("MatchControllerObj").GetComponent<MatchController>();
        gameObject.tag = "Unit";

        movementArray = new List <Vector3>();

        GameObject pObj_;

        pObj_        = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent <JTSScene0>();
        tilesArray   = scene0Script.tileArray;
        enemyArray   = scene0Script.enemyArray_debug;

        currentState = UnitState.CREATED;
    }
Ejemplo n.º 3
0
    void Start()
    {
        GameObject pObj_;

        pObj_        = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent <JTSScene0>();

        gameObject.AddComponent("InputInterface");
        //gameObject.AddComponent("DragDropSurfaceTile");
        UnHighlightTile();
        matchController = GameObject.Find("MatchControllerObj").GetComponent <MatchController>();
        isOccupied      = false;
    }
Ejemplo n.º 4
0
 void LateUpdate()
 {
     if (matchController == null)
     {
         matchController = GameObject.Find("MatchControllerObj").GetComponent <MatchController>();
     }
     if (scene0Script == null)
     {
         GameObject pObj_;
         pObj_        = GameObject.FindWithTag("oScene0");
         scene0Script = pObj_.GetComponent <JTSScene0>();
     }
 }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        if ( unitDiag == false )
        moveRangeDiag = moveRangeLR - ( moveRangeLR - 1 );
        else moveRangeDiag = moveRangeLR;

        rayHitPoint = new Vector3( 0.0f , 0.0f , 0.0f );
        onTileIndex = 0;//maybe scan tile array at start ?
        //renderer.material.color = new Color( 1 , 1 , 1 , 0.5f );
        gameObject.AddComponent("InputInterface");

        //matchController = GameObject.Find("MatchControllerObj").GetComponent<MatchController>();
        gameObject.tag = "Unit";

        movementArray = new List<Vector3>();

        GameObject pObj_;
        pObj_ = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent<JTSScene0>();
        tilesArray = scene0Script.tileArray;
        enemyArray = scene0Script.enemyArray_debug;

        currentState = UnitState.CREATED;
    }
Ejemplo n.º 6
0
 void LateUpdate()
 {
     if(matchController == null)
     {
         matchController = GameObject.Find("MatchControllerObj").GetComponent<MatchController>();
     }
     if(scene0Script == null)
     {
         GameObject pObj_;
         pObj_ = GameObject.FindWithTag("oScene0");
         scene0Script = pObj_.GetComponent<JTSScene0>();
     }
 }
Ejemplo n.º 7
0
    void Awake()
    {
        wasGenerated = false;
        _wasRender = false;
        _timeFindPath = 0;

        //s
        GameObject pObj_;
        pObj_ = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent<JTSScene0>();

        movementArray = new List<Vector3>();

        AStar.OnPathFinded += HandleAStarOnPathFinded;

        _gridTransforms = new List<List<Transform>>();
        _nodeStatesGrid = new List<List<TileController>>();
        _parentTransforms = new List<Transform>();

        _numRows = int.Parse(_numRowsString);
        _numCols = int.Parse(_numColsString);

        _camera = Camera.main;

        // ROOT PARENT just for BEAUTY STRUCTURE
        GameObject go = new GameObject("GRID_MAP_NODES");
        _parentTransform = go.transform;
    }
Ejemplo n.º 8
0
    void Start()
    {
        GameObject pObj_;
        pObj_ = GameObject.FindWithTag("oScene0");
        scene0Script = pObj_.GetComponent<JTSScene0>();

        gameObject.AddComponent("InputInterface");
        //gameObject.AddComponent("DragDropSurfaceTile");
        UnHighlightTile();
        matchController = GameObject.Find("MatchControllerObj").GetComponent<MatchController>();
        isOccupied = false;
    }