Example #1
0
    private void PlaceObject()
    {
        Vector3    objPos = tempObj.transform.localPosition;
        Vector3Int pos    = new Vector3Int(Mathf.RoundToInt(objPos.x),
                                           Mathf.RoundToInt(objPos.y),
                                           Mathf.RoundToInt(objPos.z));

        LevelMoment moment  = momDisplay.GetFocusedMoment();
        bool        changed = moment.Change(pos, key);

        if (changed)
        {
            LevelData.Instance.ChangeFuture(moment);
            logicController.updating = true;
            momDisplay.UpdateTimeline(moment);
            hudControl.RedrawHud(moment);
        }

        DisableController();
    }
    private void RemoveObject()
    {
        if (overI.x < 0)
        {
            return;
        }

        LevelMoment moment  = momDisplay.GetFocusedMoment();
        bool        changed = moment.Remove(overI, key);

        if (!changed)
        {
            return;
        }

        LevelData.Instance.ChangeFuture(moment);

        momDisplay.UpdateTimeline(moment);
        hudControl.RedrawHud(moment);
        logicController.updating = true;
    }