Exemplo n.º 1
0
    void Awake()
    {
        if (p_container == null)
            p_container = GetComponentInChildren<AmebaContainer>();

        if ((p_collider != null) && (p_collider.gameObject.GetComponent<AmebaTrigger>() == null))
        {
            p_collider.isTrigger = true;
            p_collider.gameObject.AddComponent<AmebaTrigger>();
            switch (p_activationCondition)
            {
                case ActivationType.TriggerActivated:
                    p_collider.gameObject.GetComponent<AmebaTrigger>().AddOnEnter(p_container);
                    break;
                case ActivationType.TriggerReleased:
                    p_collider.gameObject.GetComponent<AmebaTrigger>().AddOnExit(p_container);
                    break;
                case ActivationType.TriggerKeep:
                    p_collider.gameObject.GetComponent<AmebaTrigger>().AddOnStay(p_container);
                    break;
            }
        }
    }
Exemplo n.º 2
0
 public void AddOnStay(AmebaContainer container)
 {
     if (p_onStay == null)
         p_onStay = new List<AmebaContainer>();
     p_onStay.Add(container);
 }
Exemplo n.º 3
0
 public void AddOnExit(AmebaContainer container)
 {
     if (p_onExit == null)
         p_onExit = new List<AmebaContainer>();
     p_onExit.Add(container);
 }
Exemplo n.º 4
0
 public void AddOnEnter(AmebaContainer container)
 {
     if (p_onEnter == null)
         p_onEnter = new List<AmebaContainer>();
     p_onEnter.Add(container);
 }