コード例 #1
0
 public void getCloakScript(Renderer REDer)
 {
     if (!REDer.GetComponent <BeingPROCloakedScript>())
     {
         BeingPROCloakedScript BPROCS = REDer.gameObject.AddComponent <BeingPROCloakedScript>();
         BPROCS.duration                       = CloakExtendingTime.Value;
         BPROCS.InvisibleBumpedMat             = (InvBumpTex);
         BPROCS.InvisibleBumpedMat.mainTexture = (InvBumpTex.mainTexture);
         BPROCS.InvisibleMat                   = (InvTex);
         BPROCS.InvisibleMat.mainTexture       = (InvTex.mainTexture);
         // Due to detection mechanism, I have to make sure every block has a collider for cloaking detection
         BPROCS.addColliderToMe();
     }
 }
コード例 #2
0
 public void FixedUpdate()
 {
     try
     {
         Update();
         Collider[] cols = Physics.OverlapSphere(this.transform.position, this.transform.localScale.x);
         foreach (Collider col in cols)
         {
             BeingPROCloakedScript cloakingObject = col.gameObject.GetComponent <BeingPROCloakedScript>();
             if (cloakingObject != null)
             {
                 if (useFlashVFX && Flashing)
                 {
                     cloakingObject.Flash();
                 }
                 else
                 {
                     cloakingObject.InsideAField = true;
                 }
             }
         }
     }
     catch { }
 }