コード例 #1
0
    protected void Process(MessageType cameFrom, InterationType it, GameObject go)
    {
        if (it != interationType)
        {
            return;
        }

        //stays are their own thing
        if (cameFrom == MessageType.Enter && triggerType == MessageType.Stay && isCounting <= 0)
        {
            if (tagsThatPass.CheckAll(go.gameObject))
            {
                waitTimerCounter = 0;
                isCounting++;
                Tick(); //force a tick now to avoid 1 frame delay bug
            }
        }

        if (cameFrom == MessageType.Exit && triggerType == MessageType.Stay && isCounting > 0)
        {
            isCounting--;
            waitTimerCounter = 0;
        }

        //instants are much simplier
        if (triggerType == cameFrom && tagsThatPass.CheckAll(go.gameObject))
        {
            DoThing();
        }
    }
コード例 #2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (tagsThatPass.CheckAll(collision.gameObject))
     {
         var data = new GameEvents.PhysicsInteractionData();
         data.instigator = gameObject;
         data.other      = collision.gameObject;
         GameEvents.InvokeImportantPhysicsCollision(data);
     }
 }