Пример #1
0
 protected override void Start()
 {
     base.Start();
     boxMenu = transform.parent.GetComponent <BoundingBoxMenu>();
     actions = boxMenu.BoundingBox.GetComponent <BoundingBoxActions>();
     InitializeButtons();
 }
Пример #2
0
    public void SetUp()
    {
        go   = new GameObject();
        coll = go.AddComponent <BoxCollider>();
        go.AddComponent <CustomTapToPlace>();
        go.AddComponent <TransformationManager>();
        actions = go.AddComponent <BoundingBoxActions>();
        actions.boundingBoxPieces = new System.Collections.Generic.List <Transform>();
        boundingBoxPiece          = new GameObject().transform;
        actions.boundingBoxPieces.Add(boundingBoxPiece);

        actions.Start();
    }
Пример #3
0
    protected override void Start()
    {
        Debug.Log("Start of bounding box menu");
        base.Start();
        actions    = BoundingBox.GetComponent <BoundingBoxActions>();
        info       = BoundingBox.GetComponent <BoundingBoxInfo>();
        tapToPlace = BoundingBox.GetComponent <CustomTapToPlace>();
        Debug.Log("Create menu reference for " + info.Id.ToString());
        info.Menu = this;

        Debug.Log("InfoMenu: " + info.Menu);

        InitializeButtons();
        SetPlayerTypeMode();
        gameObject.SetActive(false);

        tapToPlace.OnPickUp += BoundingBoxPickedUp;
        tapToPlace.OnPlaced += BoundingBoxPlaced;
    }
Пример #4
0
    private void OnRemoteDestroy(NetworkInMessage msg)
    {
        long userId = msg.ReadInt64();

        if (userId != SharingStage.Instance.Manager.GetLocalUser().GetID())
        {
            long          boxUser       = msg.ReadInt64();
            int           boxNumber     = msg.ReadInt32();
            BoundingBoxId boundingBoxId = new BoundingBoxId(boxUser, boxNumber);
            Debug.Log("Received remote destroy for " + boundingBoxId.ToString());
            if (TransformationManager.instances.ContainsKey(boundingBoxId.ToString()))
            {
                BoundingBoxActions actions = TransformationManager.instances[boundingBoxId.ToString()].gameObject.GetComponent <BoundingBoxActions>();
                actions.DeleteLocalObject();
            }
            else
            {
                Debug.Log("Delete command for unknown bounding box: " + boundingBoxId.ToString());
            }
        }
    }