Beispiel #1
0
    protected override void SpecificInit()
    {
        // 관찰 간 조작 금지 설정
        FSLocator.textDisplayer.reactionButton.gameObject.SetActive(false);

        observationManager = FindObjectOfType <ObservationManager>();
    }
Beispiel #2
0
 public override void Initialize()
 {
     m_ResetParams      = Academy.Instance.EnvironmentParameters;
     observationManager = ObservationManager.Instance;
 }
    private void Start()
    {
        eventManager = GameObject.Find("ObservationDisplayer").GetComponent <ObservationManager>();
        EventTrigger.Entry entry1, entry2, entry3, entry4, entry5;



        // Event Trigger 컴포넌트 추가
        EventTrigger eventTrigger = gameObject.AddComponent <EventTrigger>();

        // Event Trigger 이벤트 추가
        switch (way)
        {
        case Way.PULL:
            entry1         = new EventTrigger.Entry();
            entry1.eventID = EventTriggerType.PointerDown;
            entry1.callback.AddListener((eventData) => { eventManager.OnButtonDownNPC(this); });
            eventTrigger.triggers.Add(entry1);

            entry2         = new EventTrigger.Entry();
            entry2.eventID = EventTriggerType.PointerUp;
            entry2.callback.AddListener((eventData) => { eventManager.OnButtonUpNPC(); });
            eventTrigger.triggers.Add(entry2);
            break;

        case Way.LOOK:
            entry1 = new EventTrigger.Entry
            {
                eventID = EventTriggerType.PointerDown
            };
            entry1.callback.AddListener((eventData) => { eventManager.OnButtonDownNPC(this); });
            eventTrigger.triggers.Add(entry1);

            entry2 = new EventTrigger.Entry
            {
                eventID = EventTriggerType.PointerUp
            };
            entry2.callback.AddListener((eventData) => { eventManager.OnButtonUpNPC(); });
            eventTrigger.triggers.Add(entry2);

            entry3 = new EventTrigger.Entry
            {
                eventID = EventTriggerType.PointerEnter
            };
            entry3.callback.AddListener((eventData) => { eventManager.InTouchArea(this); });
            eventTrigger.triggers.Add(entry3);

            entry4 = new EventTrigger.Entry
            {
                eventID = EventTriggerType.Drag
            };
            entry4.callback.AddListener((eventData) => { eventManager.OnDragNPC(); });
            eventTrigger.triggers.Add(entry4);

            entry5 = new EventTrigger.Entry
            {
                eventID = EventTriggerType.PointerExit
            };
            entry5.callback.AddListener((eventData) => { eventManager.OutTouchArea(); });
            eventTrigger.triggers.Add(entry5);

            break;
        }
    }