Example #1
0
        protected override void OnValidate()
        {
            // Destroy unreferenced future reference assets
            base.OnValidate();

            // Update future reference
            var needsUpdate = false;

            if (comparisonMode == InstanceCountComparison.Exactly && instanceCount == 1)
            {
                if (m_FutureReference == null)
                {
                    m_FutureReference = CreateFutureObjectReference();
                    m_FutureReference.referenceName = "Prefab Instance";
                    needsUpdate = true;
                }
            }
            else
            {
                DestroyImmediate(m_FutureReference, true);
            }

            if (needsUpdate)
            {
                UpdateFutureObjectReferenceNames();
            }
        }
Example #2
0
        public void UpdateFutureObjectReferenceName(FutureObjectReference futureReference)
        {
            int paragraphIndex;
            int criterionIndex;

            if (GetIndicesForCriterion(futureReference.criterion, out paragraphIndex, out criterionIndex))
            {
                futureReference.name = string.Format("Paragraph {0}, Criterion {1}, {2}",
                                                     paragraphIndex + 1, criterionIndex + 1, futureReference.referenceName);
            }
        }