Example #1
0
    void Awake()
    {
        EventListener.AddPopEvent(this);
        PopEvent[] popEvents = gameObject.GetComponents <PopEvent>();
        for (int i = 0; i < popEvents.Length - 1; i++)   //  Don't check the last element
        {
            if (this.Equals(popEvents[i]))
            {
                nextEvent = popEvents[i + 1];
                break;
            }
        }

        foreach (EventHalf condition in conditions)
        {
            if (condition.e_classString == "Player Enters Area" || condition.e_classString == "Player Leaves Area")
            {
                SphereCollider newCollider = gameObject.AddComponent <SphereCollider>();
                newCollider.radius    = conditionRegionRadius;
                newCollider.isTrigger = true;
                gameObject.layer      = 2;
                break;
            }
        }
    }
    void Reload()
    {
        popTarget      = (PopEvent)target;
        style          = new GUIStyle();
        style.richText = true;
#if UNITY_PRO_LICENSE
        style.normal.textColor = Color.white;
#else
        style.normal.textColor = Color.black;
#endif
        style.fontStyle = FontStyle.Bold;
        style.clipping  = TextClipping.Clip;

        EventListener.AddPopEvent(popTarget);
        duplicateId       = EventListener.CheckForDuplicateId(popTarget, popTarget.uniqueId);
        chooseACondition  = false;
        chooseAnAction    = false;
        destroyThisObject = false;
    }