zombie_mp/Assets/Scripts/scopeBehaviour.cs
2021-09-17 06:04:39 +05:30

28 lines
618 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HQFPSWeapons;
public class scopeBehaviour : MonoBehaviour
{
public Player player;
public CanvasGroup scopeCanvas;
public weaponAttachmentsMgr attachmentsMgr;
void Start()
{
player.Aim.AddStartListener(OnAimStart);
player.Aim.AddStopListener(OnAimStop);
}
void Update() {
scopeCanvas.alpha = attachmentsMgr.aimed;
}
void OnAimStart(){
attachmentsMgr.focus(true);
}
void OnAimStop(){
attachmentsMgr.focus(false);
}
}