Пример #1
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.KeypadEnter))
        {
            Orientation++;

            if (Orientation >= (OrientationEnum)4)
            {
                Orientation = 0;
            }

            SetOrientation(Orientation);
        }

        // TODO: this should be a part of the sorting system proper!
        currentY = Mathf.RoundToInt(transform.position.y - 0.5f);
        if (currentY != prevY)
        {
            prevY = currentY;

            newSortOrder = UVController.GetSortOrderFromGridY(GameGrid.GetInstance().GetNodeFromWorldPos(transform.position).GridPos.y);
            BodyRenderer.sortingOrder  = newSortOrder + 2;
            HeadRenderer.sortingOrder  = newSortOrder + 3;
            BeardRenderer.sortingOrder = newSortOrder + 4;
            EyeRenderer.sortingOrder   = newSortOrder + 5;
            HairRenderer.sortingOrder  = newSortOrder + 6;
        }
    }
Пример #2
0
    public void Setup()
    {
        if (hasSetup)
        {
            return;
        }

        hasSetup     = true;
        MyUVC        = GetComponentInChildren <UVController>(); // TODO: this may have to support multiple meshes (because bottom+top and such)
        Clickable    = GetComponent <CanClick> ();
        MyTileObject = GetComponent <NodeObject>();
    }
Пример #3
0
    void Awake()
    {
        m_dicObjTransByIndex = new Dictionary<int, Dictionary<int, Dictionary<int, Transform>>> ();
        m_dicObjIndex = new Dictionary<Transform, List<Vector3>> ();

        trans = GetComponent<Transform>();

        matController = new MatHandler (cubeTex);
        uvController = new UVController ();
        objectCombineController = new WorldObjectCombineController ();
    }