Ejemplo n.º 1
0
 void FixedUpdate()
 {
     if (totalPointsCnt > 138000)
     {
         ButtonsControl.StaticStop();
     }
     //this object will be destroyed
     if (spriteName != "FixedRectangle" && spriteName != "Spring" && spriteName != "Force")
     {
         rb.isKinematic = controlledByAnim;
     }
     if (resetting)
     {
         Reset();
     }
     if (sliderReplaying)
     {
         Adjust();
     }
     if (recording)
     {
         Record();
     }
     if (replaying)
     {
         Replay();
     }
 }
Ejemplo n.º 2
0
 void Start()
 {
     scrMedia           = FindObjectOfType <MediaPlayerCtrl> ();
     Controller         = GetComponentInParent <ButtonsControl> ();
     Mat                = GetComponent <Renderer> ().material;
     NeutralButtonColor = Mat.color;
 }
Ejemplo n.º 3
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else if (Instance != this)
     {
         Destroy(this.gameObject);
     }
     scrMedia = FindObjectOfType <MediaPlayerCtrl> ();
     Buttons  = FindObjectsOfType <ButtonFunction> ();
 }
    void Awake()
    {
        if (SystemInfo.deviceModel.Contains("rockchip"))
        {
            m_bSupportRockchip = true;
        }
        else
        {
            m_bSupportRockchip = false;
        }

#if UNITY_IPHONE
        Vector2 [] vec2UVs = m_TargetMaterial.GetComponent <MeshFilter>().mesh.uv;

        for (int i = 0; i < vec2UVs.Length; i++)
        {
            vec2UVs[i] = new Vector2(vec2UVs[i].x, 1.0f - vec2UVs[i].y);
        }

        m_TargetMaterial.GetComponent <MeshFilter>().mesh.uv = vec2UVs;
#endif
        Controller = FindObjectOfType <ButtonsControl> ();
    }
Ejemplo n.º 5
0
        public override void OnApplyTemplate()
        {
            Content = new ButtonsControl
            {
                CommandPath       = CommandPath,
                DisplayMemberPath = DisplayMemberPath,
                ItemsSource       = ItemsSource
            };

            this.WhenAnyValue(a => a.ItemsSource)
            .WhereNotNull()
            .CombineLatest(this.WhenAnyValue(a => a.DisplayMemberPath), this.WhenAnyValue(a => a.CommandPath))
            .Subscribe(tuple =>
            {
                var(i, d, c) = tuple;
                Dispatcher.InvokeAsync(() =>
                {
                    var msn = Content switch
                    {
                        null => new ButtonsControl(),
                        ButtonsControl a => a,
                        _ => throw new ApplicationException("Expected Content to be MasterNotesItemsControl")
                    };
                    msn.CommandPath       = c;
                    msn.ItemsSource       = i;
                    msn.DisplayMemberPath = d;
                    //DoubleAnimation oLabelAngleAnimation    = new DoubleAnimation();
                    //oLabelAngleAnimation.From = 0;
                    //oLabelAngleAnimation.To = this?.ActualHeight??0;
                    //oLabelAngleAnimation.Duration                    = new Duration(new TimeSpan(0, 0, 0, 0, 500));
                    //oLabelAngleAnimation.RepeatBehavior = new RepeatBehavior(4);
                    //this.BeginAnimation(MasterBindableControl.HeightProperty,                    oLabelAngleAnimation);
                }, System.Windows.Threading.DispatcherPriority.Background);
            });

            base.OnApplyTemplate();
        }
Ejemplo n.º 6
0
 void Awake()
 {
     Controller          = FindObjectOfType <ButtonsControl> ();
     youtubeVideoIdOrUrl = Controller.VideoList [0];
 }