public override void OnEnable()
        {
            base.OnEnable();
            m_PlaneSizeCondition = (PlaneSizeCondition)target;

            m_MinSizeProperty    = serializedObject.FindSerializedPropertyData("m_MinimumSize");
            m_MaxSizeProperty    = serializedObject.FindSerializedPropertyData("m_MaximumSize");
            m_MinBoundedProperty = serializedObject.FindSerializedPropertyData("m_MinBounded");
            m_MaxBoundedProperty = serializedObject.FindSerializedPropertyData("m_MaxBounded");

            m_PlaneSizeCondition.AdjustingChanged += OnAdjustingChanged;
            CleanUp();
        }
Example #2
0
        public void Setup()
        {
            m_DoubleBoundedCondition            = new GameObject("double bounded").AddComponent <PlaneSizeCondition>();
            m_DoubleBoundedCondition.minBounded = true;
            m_DoubleBoundedCondition.maxBounded = true;

            m_OnlyMinBoundedCondition = new GameObject("only min bounded").AddComponent <PlaneSizeCondition>();
            m_OnlyMinBoundedCondition.ratingConfig = new RatingConfiguration(0.25f);
            m_OnlyMinBoundedCondition.minimumSize  = k_MinPlaneSize;
            m_OnlyMinBoundedCondition.minBounded   = true;
            m_OnlyMinBoundedCondition.maxBounded   = false;

            m_OnlyMaxBoundedCondition = new GameObject("only max bounded").AddComponent <PlaneSizeCondition>();
            m_OnlyMaxBoundedCondition.ratingConfig = new RatingConfiguration(0.25f);
            m_OnlyMaxBoundedCondition.maximumSize  = k_MaxPlaneSize;
            m_OnlyMaxBoundedCondition.minBounded   = false;
            m_OnlyMaxBoundedCondition.maxBounded   = true;
        }
Example #3
0
        static float Rate(PlaneSizeCondition condition, float inputX, float inputY)
        {
            var input = new Vector2(inputX, inputY);

            return(condition.RateDataMatch(ref input));
        }