Пример #1
0
    // Update is called once per frame
    private void Update()
    {
        if (!IsPlayerInRange())
        {
            IsBeingLookedAt = false;
        }
        else
        {
            RaycastHit hit;
            if (Physics.Raycast(
                    camera.transform.position,
                    camera.transform.forward,
                    out hit,
                    MaxInteractDistance,
                    Layers.FriendlyProjectilesMask))
            {
                IsBeingLookedAt = MonoBehaviourUtils.IsChildOrSelf(gameObject, hit.transform.gameObject);
            }
            else
            {
                IsBeingLookedAt = false;
            }
        }

        if (!IsOccupied && IsBeingLookedAt)
        {
            ShowSilhouette();
        }
        else
        {
            HideSilhouette();
        }
    }
 public override void UnBindings()
 {
     MonoBehaviourUtils.RemoveComponent <LaserPooler>(gameObject);
 }
Пример #3
0
 public void RemoveExtansion <T>() where T : Component
 {
     MonoBehaviourUtils.RemoveComponent <T>(gameObject);
 }
Пример #4
0
        public T GetOrAddExtension <T>() where T : Component
        {
            T result = MonoBehaviourUtils.GetOrAddComponent <T>(gameObject);

            return(result);
        }
Пример #5
0
 public static GameObject FindGameObjectInScene(string name)
 {
     CreateMonoBehaviourInstanceIfNeeded();
     return(MonoBehaviourUtils.FindGameObjectInScene(name));
 }
Пример #6
0
 public static T FindObjectOfTypeInScene <T>() where T : UnityEngine.Object
 {
     CreateMonoBehaviourInstanceIfNeeded();
     return(MonoBehaviourUtils.FindObjectOfTypeInScene <T>());
 }
Пример #7
0
 public static void StartStaticCoroutine(IEnumerator coroutine)
 {
     CreateMonoBehaviourInstanceIfNeeded();
     MonoBehaviourUtils.StartStaticCoroutine(coroutine);
 }