This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using SegmentedControlSample.Controls; | |
using Xamarin.Forms; | |
namespace SegmentedControlSample | |
{ | |
public class SegmentedBarControl: ScrollViewWithNotBar | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:SegmentedControlSample" | |
x:Class="SegmentedControlSample.SegmentedControlSamplePage"> | |
<StackLayout Padding="0,5"> | |
<local:SegmentedBarControl ValueChanged="Handle_ValueChanged" | |
x:Name="segment" | |
AutoScroll="true" | |
TextColor="Black" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xamarin.Forms; | |
namespace SegmentedControlSample.Controls | |
{ | |
public class ScrollViewWithNotBar : ScrollView | |
{ | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using SegmentedControlSample.Controls; | |
using SegmentedControlSample.Droid.Renderers; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer(typeof(ScrollViewWithNotBar),typeof(ScrollViewWithNotBarRenderer))] | |
namespace SegmentedControlSample.Droid.Renderers | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.ComponentModel; | |
using SegmentedControlSample.Controls; | |
using SegmentedControlSample.iOS.Renderers; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ExportRenderer(typeof(ScrollViewWithNotBar),typeof(ScrollViewWithNotBarRenderer))] | |
namespace SegmentedControlSample.iOS.Renderers | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using SegmentedControlSample.Controls; | |
using Xamarin.Forms; | |
namespace SegmentedControlSample | |
{ | |
public class SegmentedBarControl: ContentView | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:SegmentedControlSample" | |
x:Class="SegmentedControlSample.SegmentedControlSamplePage"> | |
<StackLayout Padding="0,5"> | |
<local:SegmentedBarControl ValueChanged="Handle_ValueChanged" | |
x:Name="segment" | |
AutoScroll="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCNNode CreatePokemonNodeFromFile(string filePath,string nodeName,SCNVector3 vector) | |
{ | |
var pScene = SCNScene.FromFile(filePath); | |
var pokemon = pScene.RootNode.FindChildNode(nodeName, true); | |
pokemon.Position = vector; | |
pokemon.PhysicsBody = SCNPhysicsBody.CreateStaticBody(); | |
pokemon.PhysicsBody.PhysicsShape = SCNPhysicsShape.Create(pokemon); | |
pokemon.PhysicsBody.ContactTestBitMask = (int)BitMaskCategory.Pokeball; | |
pokemon.PhysicsBody.CategoryBitMask = (int)BitMaskCategory.Pokemon; | |
return pokemon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void ViewWillAppear(bool animated) | |
{ | |
base.ViewWillAppear(animated); | |
// Create a session configuration | |
var configuration = new ARWorldTrackingConfiguration { | |
PlaneDetection = ARPlaneDetection.Horizontal, | |
LightEstimationEnabled = true | |
}; | |
SceneView.DebugOptions = ARSCNDebugOptions.ShowFeaturePoints | ARSCNDebugOptions.ShowWorldOrigin; | |
// Run the view's session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PhysicsDelegate : SCNPhysicsContactDelegate | |
{ | |
IList<SCNNode> animatedNodes=new List<SCNNode>(); | |
public override void DidBeginContact(SCNPhysicsWorld world, SCNPhysicsContact contact) | |
{ | |
var nodeA = contact.NodeA; | |
var nodeB = contact.NodeB; | |
SCNNode target = null; | |
if (nodeA.PhysicsBody.CategoryBitMask == (int)BitMaskCategory.Pokemon) |