Exemple #1
0
 void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData)
 {
     if (cursorDefaultStyleDisposer == null)
     {
         cursorDefaultStyleDisposer = GameCursor.SetCursor(CursorType.Default);
     }
 }
    public void OnExitFocus()
    {
        GameCursor.SetCursor(ENUM_CURSOR.NORMAL);
        if (base.gameObject.name == "Player")
        {
            return;
        }
        GameObject gameObject = GameObject.Find("Player");

        if (gameObject)
        {
            M_PlayerController component = gameObject.GetComponent <M_PlayerController>();
            if (component)
            {
                component.m_PickTarget = null;
                this.OnHeadLookAt(gameObject, null);
            }
        }
        GameObject ridePetObj = Swd6Application.instance.m_ExploreSystem.RidePetObj;

        if (ridePetObj != null)
        {
            M_RidePetController component2 = ridePetObj.GetComponent <M_RidePetController>();
            if (component2)
            {
                component2.m_PickTarget = null;
            }
        }
    }
    public void SetupButtons()
    {
        ButtonPooler.DeactivateAll();

        foreach (var thing in _game.ThingConfigs.OrderBy(t => t.TypeOfThing.ToString()))
        {
            var obj = ButtonPooler.GetPooledObject();
            obj.GetComponentInChildren <Text>().text = thing.Name.ToUppercaseFirst();
            obj.SetActive(true);

            obj.transform.GetComponentInChildrenExcludingParent <Image>().sprite = Assets.GetSprite(thing.Sprite);

            var button = obj.GetComponentInChildren <Button>();
            button.onClick.RemoveAllListeners();
            button.onClick.AddListener(() => {
                _cursor.SetCursor(thing.TypeOfThing, false);
            });
        }
    }
Exemple #4
0
    public void SetupGroupButtons(ConstructionGroup group)
    {
        ButtonPooler.DeactivateAll();

        var things = _game.ThingConfigs.Where(t => t.ConstructionConfig != null && t.ConstructionConfig.Group == group).ToList();

        foreach (var thing in things)
        {
            var obj = ButtonPooler.GetPooledObject();
            obj.GetComponentInChildren <Text>().text = thing.Name.ToUppercaseFirst();
            obj.SetActive(true);

            obj.transform.GetComponentInChildrenExcludingParent <Image>().sprite = Assets.GetSprite(thing.Sprite);

            var button = obj.GetComponentInChildren <Button>();
            button.onClick.RemoveAllListeners();
            button.onClick.AddListener(() => {
                _cursor.SetCursor(thing.TypeOfThing, true);
            });
        }
    }
    public void OnMouseOver()
    {
        if (this.UpdateMouseUIEvent())
        {
            GameCursor.SetCursor(ENUM_CURSOR.NORMAL);
            return;
        }
        if (base.gameObject.name == "Player")
        {
            return;
        }
        if (this.Invalid)
        {
            return;
        }
        if (Swd6Application.instance.m_ExploreSystem.LockPlayer)
        {
            return;
        }
        GameObject gameObject = GameObject.Find("Player");

        if (gameObject)
        {
            M_PlayerController component = gameObject.GetComponent <M_PlayerController>();
            if (component && this.Pick)
            {
                component.m_PickTarget = base.gameObject;
                this.OnHeadLookAt(gameObject, base.gameObject);
                if (this.m_NpcData.emType == ENUM_NpcType.Treasure && this.HideRole && this.m_NpcData.Show == 0 && this.m_NpcData.emActionHint == ENUM_ActionHint.Null)
                {
                    return;
                }
                if (this.m_NpcData.emType == ENUM_NpcType.Mine)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.GATHER);
                }
                else if (this.m_NpcData.emType == ENUM_NpcType.Treasure || this.m_NpcData.emType == ENUM_NpcType.Egg)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.PICK);
                }
                else if (this.m_NpcData.emType == ENUM_NpcType.Trap)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.SEE);
                }
                else
                {
                    GameCursor.SetCursor(ENUM_CURSOR.TALK);
                }
            }
        }
        GameObject ridePetObj = Swd6Application.instance.m_ExploreSystem.RidePetObj;

        if (ridePetObj != null)
        {
            M_RidePetController component2 = ridePetObj.GetComponent <M_RidePetController>();
            if (component2)
            {
                component2.m_PickTarget = base.gameObject;
                if (this.m_NpcData.emType == ENUM_NpcType.Mine)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.GATHER);
                    return;
                }
                if (this.m_NpcData.emType == ENUM_NpcType.Treasure || this.m_NpcData.emType == ENUM_NpcType.Egg)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.PICK);
                    return;
                }
                if (this.m_NpcData.emType == ENUM_NpcType.Trap)
                {
                    GameCursor.SetCursor(ENUM_CURSOR.SEE);
                    return;
                }
                GameCursor.SetCursor(ENUM_CURSOR.TALK);
            }
        }
    }