void Update()
        {
            if (shootState != ShootState.not_shooting)
            {
                shootState = ShootState.not_shooting;
            }

            // TODO: Ideally should work with dictionary<int,matType> - GetButton(Material{int})->currentMat=dict[int]
            if (Input.GetKeyDown("1"))
            {
                currentMaterial = FloopableMaterialTypes.Reflective;
            }
            if (Input.GetKeyDown("2"))
            {
                currentMaterial = FloopableMaterialTypes.Opaque;
            }
            if (Input.GetKeyDown("3"))
            {
                currentMaterial = FloopableMaterialTypes.GoThrough;
            }
            if (Input.GetMouseButtonDown(0))
            {
                Shoot();
            }
        }
        // Start is called before the first frame update
        void Start()
        {
            currentMaterial = gun.currentMaterial;

            for (int icon = 0; icon < materialIcons.Length; icon++)
            {
                var tempColor = materialIcons[icon].color;
                tempColor.a = (FloopableMaterialTypes)icon == currentMaterial ? activeAlpha : inactiveAlpha;
                materialIcons[icon].color = tempColor;
            }
        }
예제 #3
0
 public void ChangeMaterial(FloopableMaterialTypes newMaterial)
 {
     currentMaterial = newMaterial;
     UpdateMaterial();
 }