Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            var rifle = new BaseRifle();
            Debug.Log(rifle.GetAccuracy());
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            var rifle = new Scope(new Stabilizer(new BaseRifle()));
            Debug.Log(rifle.GetAccuracy());
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            var rifle = new Scope(new BaseRifle());
            Debug.Log(rifle.GetAccuracy());
        }
    }
 public abstract void SetRifle(BaseRifle rifle);
 public override void SetRifle(BaseRifle rifle)
 {
     _baseRifle = rifle;
 }