Пример #1
0
    protected override void SetActiveAreaEventButton(string btnName, bool active)
    {
        switch (btnName)
        {
        case "BTN_CHAIR":
            if (MonoBehaviourSingleton <LoungeManager> .IsValid())
            {
                nearChairPoint = MonoBehaviourSingleton <LoungeManager> .I.TableSet.GetNearSitPoint(MonoBehaviourSingleton <LoungeManager> .I.HomePeople.selfChara);

                if (nearChairPoint.sittingChara != null)
                {
                    SetActive((Enum)UI.BTN_CHAIR, false);
                }
                else
                {
                    SetActive((Enum)UI.BTN_CHAIR, active);
                }
            }
            break;
        }
    }
Пример #2
0
    public ChairPoint GetNearSitPoint(HomePlayerCharacterBase character)
    {
        //IL_0009: Unknown result type (might be due to invalid IL or missing references)
        //IL_000e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0013: Unknown result type (might be due to invalid IL or missing references)
        //IL_001b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0028: Unknown result type (might be due to invalid IL or missing references)
        //IL_002d: Unknown result type (might be due to invalid IL or missing references)
        float      num      = 3.40282347E+38f;
        ChairPoint result   = null;
        Vector3    position = character.get_transform().get_position();

        for (int i = 0; i < chairSitPoints.Count; i++)
        {
            float num2 = Vector3.Distance(position, chairSitPoints[i].get_transform().get_position());
            if (num > num2)
            {
                result = chairSitPoints[i];
                num    = num2;
            }
        }
        return(result);
    }