示例#1
0
    public override void OnInstantiate()
    {
        col         = GetComponent <CircleCollider2D>();
        col.enabled = false;

        rend         = GetComponentInChildren <SpriteRenderer>();
        rend.enabled = false;

        transferer = GetComponent <Transferer>();
        transferer.OnInstantiate();
        //return snowball back to the pool if end point reached
        transferer.OnMoveEndEvent.AddListener(Miss);

        gameObject.SetActive(false);
    }
示例#2
0
    public override void OnInstantiate()
    {
        Col         = GetComponent <CircleCollider2D>();
        Col.enabled = false;

        rb             = GetComponent <Rigidbody2D>();
        rb.isKinematic = true;

        rend         = GetComponentInChildren <SpriteRenderer>();
        rend.enabled = false;

        nameTxt = GetComponentInChildren <TextMesh>();

        transferer = GetComponent <Transferer>();
        transferer.OnInstantiate();
        //After ended movement action, recheck for another action to perform
        transferer.OnMoveEndEvent.AddListener(Act);
    }