Пример #1
0
 void OnEnable()
 {
     inf = (Influencer)target;
     alternativeTarget = serializedObject.FindProperty("alternativeTarget");
     targetingCurve    = serializedObject.FindProperty("targetingCurve");
     relaxingCurve     = serializedObject.FindProperty("relaxingCurve");
 }
        private void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.GetComponent <Influencer>())
            {
                inf = other.gameObject.GetComponent <Influencer>();

                if (inf.useAlternativeTarget)
                {
                    target = inf.alternativeTarget.transform;
                }
                else
                {
                    GameObject go = new GameObject();
                    go.transform.position = inf.targetPosition;
                    target = go.transform;
                }

                counterEnter     = 0;
                targetIsDetected = true;
                path.GetComponent <FlyThroughPath>().follow = false;
            }
        }