Exemple #1
0
    public void fire(GameObject so)
    {
        //this.so = so;
        IPlayerActions im = (IPlayerActions)so.GetComponent <PlayerController>();

        im.setIfCanFire(false);
        Rigidbody2D clone = this.GetComponent <Rigidbody2D>();

        clone.gravityScale = 0.0f;
        clone.velocity     = so.transform.TransformDirection(Vector3.left * 30);
        Debug.Log(clone.velocity);
        ctime_reach_end = Time.time;
    }
Exemple #2
0
    void OnDestroy()
    {
        IPlayerActions im = (IPlayerActions)so.GetComponent <PlayerController>();

        im.setIfCanFire(true);
    }