Esempio n. 1
0
    IEnumerator MoveResultsRoutine(UseableEntity[] useableEntities, Transform origin)
    {
        UIUseableEntityList listUI = Instantiate(useableEntityListPrefab, Game.UIHandler.InWorldCanvas.transform);

        listUI.Init(new SubscribableList <UseableEntity>(useableEntities));

        float duration             = lerpToDockCurve.keys[lerpToDockCurve.length - 1].time;
        float dockOffsetLerpAmount = Game.Dock.GetFilledFloat();
        float t = 0;

        while ((t += Time.deltaTime) < duration)
        {
            DockLocation dockL = Game.Camera.GetDockLocationInWorld();
            listUI.transform.position = Vector3.Lerp(origin.position + SpawnOffsetFromOrigin, Vector3.Lerp(dockL.LeftBot, dockL.RightBot, dockOffsetLerpAmount), lerpToDockCurve.Evaluate(t));
            yield return(null);
        }

        Game.Dock.Add(useableEntities);
        Destroy(listUI.gameObject);
    }
Esempio n. 2
0
    public void CreateUI(Dock dock)
    {
        UIUseableEntityList instance = Instantiate(uIdockPrefab, UICanvas.transform);

        instance.Init(dock.GetUseableEntityList());
    }