Exemple #1
0
    public override void OnEvent(PlaceConstruction evnt)
    {
        BoltEntity boltEntity = BoltNetwork.Instantiate(evnt.PrefabId, evnt.Position, evnt.Rotation);

        if (boltEntity.GetComponent <TreeStructure>())
        {
            boltEntity.GetComponent <TreeStructure>().TreeId = evnt.TreeIndex;
        }
        if (evnt.Parent)
        {
            boltEntity.transform.parent = evnt.Parent.transform;
        }
        if (evnt.AboveGround)
        {
            FoundationArchitect component = boltEntity.GetComponent <FoundationArchitect>();
            if (component)
            {
                component._aboveGround = evnt.AboveGround;
            }
        }
        boltEntity.SendMessage("OnDeserialized", SendMessageOptions.DontRequireReceiver);
        LocalPlayer.Create.RefreshGrabber();
    }