コード例 #1
0
    private IEnumerator Start()
    {
        if (infos != null)
        {
            while (!MonoBehaviourSingleton <AppMain> .IsValid() || MonoBehaviourSingleton <AppMain> .I.mainCamera == null)
            {
                yield return((object)null);
            }
            grabCommand = MonoBehaviourSingleton <AppMain> .I.mainCamera.get_gameObject().GetComponent <GrabCommand>();

            if (grabCommand == null)
            {
                grabCommand = MonoBehaviourSingleton <AppMain> .I.mainCamera.get_gameObject().AddComponent <GrabCommand>();

                grabCommand.ApplyCommandBuffer(cameraEvent);
            }
            renderTexture = grabCommand.useRenderTexture(this.get_gameObject());
            for (int j = 0; j < infos.Length; j++)
            {
                if (!(infos[j].targetRenderer == null) && !string.IsNullOrEmpty(infos[j].texturePropertyName))
                {
                    TextureSetInfo info     = infos[j];
                    Renderer       renderer = info.targetRenderer;
                    for (int i = 0; i < renderer.get_sharedMaterials().Length; i++)
                    {
                        if (renderer.get_sharedMaterials()[i].HasProperty(info.texturePropertyName))
                        {
                            renderer.get_sharedMaterials()[i].SetTexture(info.texturePropertyName, renderTexture);
                        }
                    }
                }
            }
        }
    }
コード例 #2
0
 //被抓取
 protected virtual CommandReplyType CheckGrab(GrabCommand cmd)
 {
     if (CannotControlSelf())
     {
         return(CommandReplyType.NO);
     }
     if (GetActorState(ActorStateType.IsDivine))
     {
         return(CommandReplyType.NO);
     }
     m_ActorSkill.Clear();
     ChangeState <ActorGrabFsm>();
     return(CommandReplyType.YES);
 }