123456789101112131415161718192021222324252627 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using HQFPSWeapons;
- public class redDotBehaviour : MonoBehaviour
- {
- public Player player;
- public Material redDotMaterial;
- public weaponAttachmentsMgr attachmentsMgr;
- void Start()
- {
- player.Aim.AddStartListener(OnAimStart);
- player.Aim.AddStopListener(OnAimStop);
- }
- void Update() {
- redDotMaterial.color = new Color(redDotMaterial.color.r, redDotMaterial.color.g, redDotMaterial.color.b, attachmentsMgr.aimed);
- }
- void OnAimStart(){
- attachmentsMgr.focus(true);
- }
- void OnAimStop(){
- attachmentsMgr.focus(false);
- }
- }
|