Skip to content
Snippets Groups Projects
Select Git revision
  • d1851c821ca8f9ee7fc5490467230e30851fdcc0
  • master default
  • fin/ulo-section
  • week45/fancy-builds
  • fin/applogos
  • week41/final-review
  • week41/review-again
  • week41/reporting-on-app
  • week40/apppep
  • week40/review-report
  • week40/elementary
  • week39/transitive
  • week39/lazy-scores
  • week39/application-sections-fix
  • week39/feedback-holes
  • week39/feedback-versioning
  • week38/slide-review
  • issue13/fix
  • issue13/version-upgrade
  • issue12/setup
  • issue10/explorer
21 results

slides.tex

Blame
  • OpenFactExplorer.cs 933 B
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.EventSystems;
    
    [RequireComponent(typeof(FactWrapper))]
    public class OpenFactExplorer : MonoBehaviour, IPointerClickHandler
    {
        public GameObject factExplorerPrefab;
    
        private static Transform factExplorer;
    
        public void OnPointerClick(PointerEventData eventData)
        {
            // TODO: add support for other input systems
            Destroy(factExplorer != null ? factExplorer.gameObject : null);
            if (eventData.button == PointerEventData.InputButton.Right)
            {
                var parent = transform.GetComponentInParent<Canvas>().transform;
                var fact = transform.GetComponent<FactWrapper>().fact;
    
                factExplorer = Instantiate(factExplorerPrefab.transform, Input.mousePosition, Quaternion.identity, parent);
                factExplorer.GetComponent<FactExplorer>().Initialize(fact);
            }
        }
    }