コード例 #1
0
        private void AddPriority(PatternBase pattern)
        {
            float p = currentPriority[pattern];

            p += priorityMult * (pattern.GetPriority() / priorityMid);

            p = Mathf.Clamp(p, 0, pattern.GetPriority());

            currentPriority[pattern] = p;
        }
コード例 #2
0
        private void SubtractPriority(PatternBase pattern)
        {
            float p = currentPriority[pattern];

            p -= priorityMid;

            p = Mathf.Clamp(p, 0, pattern.GetPriority());

            currentPriority[pattern] = p;
        }