Exemplo n.º 1
0
    private GameObject SetupOrigin(OriginNode origin)
    {
        Direction  direction = RoadDrawer.StringToDirection(origin.direction);
        Coordinate coords    = origin.coords;

        return(Instantiate(roadTiles.cfcTile, new Vector3(translator.translateToSceneRow(coords.x), translator.translateToSceneColumn(coords.y), 0f),
                           Quaternion.Euler(0, 0, (float)direction)) as GameObject);
    }
Exemplo n.º 2
0
 void Start()
 {
     van                    = GameObject.Find("Van");
     this.level             = BoardManager.currentLevel;
     van.transform.position = translator.translateVector(level.origin.coords.vector);
     van.transform.Rotate(new Vector3(0, 0, (int)RoadDrawer.StringToDirection(level.origin.direction)));
     van.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
     van.transform.position  += ForwardABit(van.transform, 0.5f);
     DOTween.defaultEaseOvershootOrAmplitude = 0;
 }
Exemplo n.º 3
0
    private void SetupVan()
    {
        GameObject van = GameObject.Find("Van");

        van.transform.position = translator.translateToSceneVector(currentLevel.origin.coords.vector);
        int direction = (int)RoadDrawer.StringToDirection(currentLevel.origin.direction);

        van.transform.rotation = Quaternion.identity;
        van.transform.Rotate(new Vector3(0, 0, direction));
        van.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
        van.transform.position  += VehicleMover.ForwardABit(van.transform, 0.5f);
        DOTween.defaultEaseOvershootOrAmplitude   = 0;
        van.GetComponent <SpriteRenderer>().color = Color.white;

        BoardManager.SetBoardAsParent(van);
    }