コード例 #1
0
        static void Main(string[] args)
        {
            ClientContext.PreloadNativeLibraries();
            using (ServerAutoStarter serverAutoStarter = new ServerAutoStarter())
                using (OSVR.ClientKit.ClientContext context = new OSVR.ClientKit.ClientContext("com.osvr.exampleclients.managed.Direction"))
                {
#if NET20
                    using (var direction = DirectionInterface.GetInterface(context, Path))
#else
                    using (var direction = context.GetDirectionInterface(Path))
#endif
                    {
                        direction.StateChanged += direction_StateChanged;

                        // Pretend that this is your application's main loop
                        for (int i = 0; i < 1000000; ++i)
                        {
                            context.update();
                            var directionState = direction.GetState();
                            Console.WriteLine("Direction State: {0}", FormatDirectionReport(directionState.Value));
                        }

                        Console.WriteLine("Library shut down; exiting.");
                    }
                }
        }
コード例 #2
0
    protected new void Awake()
    {
        base.Awake();
        (_coll = GetComponent <CircleCollider2D>()).enabled = false;
        (_rend = GetComponent <SpriteRenderer>()).enabled   = false;

        CooldownTimer = 2.5f;

        this.DoActionInNextFrame(() =>
        {
            if (Holder.gameObject == ControlBase.PlayerGameObject)
            {
                _directionGUI = BasicLib.InstantiatePrefabTr("gui/" + typeof(DirectionInterface).Name, transform).GetComponent <DirectionInterface>();
                _directionGUI.gameObject.SetActive(false);
                _directionGUI.transform.localScale = new Vector3(0.15f, 0.15f);
            }
        });



        AttackOnAirState      s1 = new AttackOnAirState(_ASM, this);
        ChagnedDirectionState s2 = new ChagnedDirectionState(_ASM, this);

        s1.SetTargetStates(s2);
        _ASM.InitializeWithStates(new InactiveEnabledDisableAttackState(_ASM, this), s1);

        ClearCooldown();
    }
コード例 #3
0
 public Direction(ClientContext context, String path)
 {
     directionInterface = context.GetDirectionInterface(path);
     directionInterface.StateChanged += DirectionInterface_StateChanged;
 }
コード例 #4
0
 public Direction(ClientContext context, String path)
 {
     directionInterface = context.GetDirectionInterface(path);
     directionInterface.StateChanged += DirectionInterface_StateChanged;
 }