28 lines
705 B
C#
28 lines
705 B
C#
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);
|
|
}
|
|
}
|