コード例 #1
0
ファイル: SharedDoors.cs プロジェクト: rustmy/oxideplugins-1
            public bool isPlayerAuthorized()
            {
                bool isIn = false;
                BuildPrivilegeTrigger trigger = Player.FindTrigger <BuildPrivilegeTrigger>();

                if (trigger != null)
                {
                    isIn = trigger.privlidgeEntity.IsAuthed(Player);
                }
                return(isIn);
            }
コード例 #2
0
        private bool updateTrigger(BuildPrivilegeTrigger bpt)
        {
            var col        = bpt.GetComponent <UnityEngine.Collider>();
            var wasTrigger = true;

            if (col != null)   // should always be the case
            {
                if (col is SphereCollider && Mathf.Approximately((col as SphereCollider).radius, radius))
                {
                    return(false); // Already a sphere with that radius
                }
                wasTrigger = col.isTrigger;
                UnityEngine.Object.Destroy(col);
            }
            col = bpt.gameObject.AddComponent <SphereCollider>();
            col.transform.localPosition  = Vector3.zero;
            col.transform.localScale     = Vector3.one;
            ((SphereCollider)col).radius = radius;
            col.isTrigger = wasTrigger;
            return(true);
        }
コード例 #3
0
        private bool updateTrigger(BuildPrivilegeTrigger bpt)
        {
            var col = bpt.GetComponent <UnityEngine.Collider>();

            return(true);
        }