Exemple #1
0
    void Start()
    {
        input = gameObject.AddComponent <InputAggregator>();

        rb = GetComponent <Rigidbody>();

        contactTracker = ContactTracker.AttachOrFind(gameObject);
    }
Exemple #2
0
    public static ContactTracker   AttachOrFind(GameObject go)
    {
        ContactTracker ct = go.GetComponent <ContactTracker>();

        if (ct)
        {
            return(ct);
        }

        ct = go.AddComponent <ContactTracker>();
        return(ct);
    }
    void Start()
    {
        rb = GetComponentInParent <Rigidbody>();

        contactTracker = ContactTracker.AttachOrFind(transform.root.gameObject);
    }