scriptingname cp是什么意思思

LanguageEnglish
Script language
Select your preferred scripting language. All code snippets will be displayed in this language.
UnityEngine
Inherits from:
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Sumbission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Your email
Suggestion *
Submit suggestion
Description
A Camera is a device through which the player views the world.
A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top
is (,). The z position is in world units from the camera.A viewport space point is normalized and relative to the camera. The bottom-left of the camera is
(0,0); the top-right is (1,1). The z position is in world units from the camera.A world space point is defined in global coordinates (eg. Transform.position).See Also: .
Static Variables
Returns all enabled cameras in the scene.
The number of cameras in the current scene.
The camera we are currently rendering with, for low-level render control only (Read Only).
The first enabled camera tagged "MainCamera" (Read Only).
Event that is fired after any camera finishes rendering.
Event that is fired before any camera starts culling.
Event that is fired before any camera starts rendering.
Actually used rendering path (Read Only).
The aspect ratio (width divided by height).
The color with which the screen will be cleared.
Matrix that transforms from camera space to world space (Read Only).
How the camera clears the background.
Should the camera clear the stencil buffer after the deferred light pass?
Number of command buffers set up on this camera (Read Only).
This is used to render parts of the scene selectively.
Camera's depth in the camera rendering order.
How and if camera generates a depth texture.
Mask to select which layers can trigger events on the camera.
The far clipping plane distance.
The field of view of the camera in degrees.
High dynamic range rendering.
Per-layer culling distances.
How to perform per-layer culling for a Camera.
The near clipping plane distance.
Opaque object sorting mode.
Is the camera orthographic (true) or perspective (false)?
Camera's half-size when in orthographic mode.
How tall is the camera in pixels (Read Only).
Where on the screen is the camera rendered in pixel coordinates.
How wide is the camera in pixels (Read Only).
Set a custom projection matrix.
Where on the screen is the camera rendered in normalized coordinates.
Rendering path.
Distance to a point where virtual eyes converge.
Stereoscopic rendering.
Render only once and use resulting image for both eyes.
Distance between the virtual eyes.
Set the target display for this Camera.
Destination render texture.
Transparent object sorting mode.
Whether or not the Camera will use occlusion culling during rendering.
Get the world-space speed of the camera (Read Only).
Matrix that transforms from world to camera space.
Public Functions
Add a command buffer to be executed at a specified place.
Calculates and returns oblique near-plane projection matrix.
Makes this camera's settings match other camera.
Get command buffers to be executed at a specified place.
Remove all command buffers set on this camera.
Remove command buffer from execution at a specified place.
Remove command buffers from execution at a specified place.
Render the camera manually.
Render into a static cubemap from this camera.
Render the camera with shader replacement.
Revert the aspect ratio to the screen's aspect ratio.
Make the projection reflect normal camera's parameters.
Remove shader replacement from camera.
Make the rendering position reflect the camera's position in the scene.
Returns a ray going from camera through a screen point.
Transforms position from screen space into viewport space.
Transforms position from screen space into world space.
Make the camera render with shader replacement.
Sets the Camera to render to the chosen buffers of one or more RenderTextures.
Returns a ray going from camera through a viewport point.
Transforms position from viewport space into screen space.
Transforms position from viewport space into world space.
Transforms position from world space into screen space.
Transforms position from world space into viewport space.
Static Functions
Fills an array of Camera with the current cameras in the scene, without allocating a new array.
OnPostRender is called after a camera has finished rendering the scene.
OnPreCull is called before a camera culls the scene.
OnPreRender is called before a camera starts rendering the scene.
OnRenderImage is called after all rendering is complete to render image.
OnRenderObject is called after camera has rendered the scene.
OnWillRenderObject is called once for each camera if the object is visible.
Delegate type for camera callbacks.
Inherited members
Enabled Behaviours are Updated, disabled Behaviours are not.
Has the Behaviour had enabled called.
The game object this component is attached to. A component is always attached to a game object.
The tag of this game object.
The Transform attached to this GameObject (null if there is none attached).
Should the object be hidden, saved with the scene or modifiable by the user?
The name of the object.
Public Functions
Calls the method named methodName on every MonoBehaviour in this game object or any of its children.
Is this game object tagged with tag ?
Returns the component of Type type if the game object has one attached, null if it doesn't.
Returns the component of Type type in the GameObject or any of its children using depth first search.
Returns the component of Type type in the GameObject or any of its parents.
Returns all components of Type type in the GameObject.
Returns all components of Type type in the GameObject or any of its children.
Returns all components of Type type in the GameObject or any of its parents.
Calls the method named methodName on every MonoBehaviour in this game object.
Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
Returns the instance id of the object.
Returns the name of the game object.
Static Functions
Removes a gameobject, component or asset.
Destroys the object obj immediately. You are strongly recommended to use Destroy instead.
Makes the object target not be destroyed automatically when loading a new scene.
Returns the first active loaded object of Type type.
Returns a list of all active loaded objects of Type type.
Clones the object original and returns the clone.
Does the object exist?
Compares if two objects refer to a different object.
Compares two object references to see if they refer to the same object.嗨,Scripting Guy!
可以使用指令碼編輯 .INI 檔案嗎?
嗨,Scripting Guy!可以使用指令碼編輯 .INI 檔案嗎?
MZ,您好。可以的,您「可以」使用指令碼編輯 .INI 檔案 (或任何種類的文字檔)。您必須使用的方法可能不是世界上最聰明的程序,但是它肯定行得通。這就是我們想要的,不是嗎?
在我們討論編輯 .INI 檔的原因之前,先看一下範例檔案。這個範例剛好是 Adobe Reader 的部份 .INI 檔,雖然大部份 .INI 檔看起來都相似:
[OEM Install]
DisplayWelcomeDlg=YES
DisplayEULA=NO
DisplayTypeOfInstallDlg=NO
DisplaySelectDestDirDlg=YES
DisplayCustomDlg=NO
DisplayUserInfoDlg=NO
DisplayConfirmRegDlg=NO
DisplayStartCopyDlg=NO
DisplayFinishDlg=NO
DisplayFinalMessage=YES
DisplayRebootDlg=YES
ProgGroupName=
DefaultDestDir=
UserCompanyName=
UserSerialNumber=
假設我們要對這個檔案做兩件事情:我們要將 DisplayWelcomeDlg 變更為 NO,且要將 UserName 設定為 Ken Myer。理想的狀況是,我們撰寫一個指令碼簡單搜尋 DisplayWelcomeDlg 的檔案、然後將指派的值變更為 NO、搜尋 UserName 屬性、將值設定為 Ken Myer,然後再儲存變更。令人遺憾的是,FileSystemObject (用來讀取並修改文字檔的技術) 並沒有這些功能。所以,我們必須以強迫方式編輯 .INI 檔。也許此時您還是不太瞭解,但希望在閱讀完這個專欄後,您就會瞭解我們所說的意思。 我們將示範一個完整的指令碼,並解釋它的作用:
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("sample.ini", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
intLineFinder = InStr(strNextLine, "DisplayWelcomeDlg")
If intLineFinder && 0 Then
strNextLine = "DisplayWelcomeDlg=NO"
intLineFinder = InStr(strNextLine, "UserName")
If intLineFinder && 0 Then
strNextLine = "UserName=Ken Myer"
strNewFile = strNewFile & strNextLine & vbCrLf
objTextFile.Close
Set objTextFile = objFSO.OpenTextFile("sample.ini", ForWriting)
objTextFile.WriteLine strNewFile
objTextFile.Close
先定義兩個常數:ForReading 及 ForWriting。在讀取及寫入 .INI 檔時需要這兩個常數。請注意,沒有名為 ForEditing 的常數;原因是 FileSystemObject 不允許您同時讀取及寫入一個檔案。我們反而是要開啟檔案並讀取,然後關閉檔案,再重新開啟來寫入。此時,我們才能儲存變更。就像我們說的,它不是一項最聰明的系統,但是它就是可以用。定義完兩個常數後,開啟 .INI 檔 (sample.ini) 讀取。接下來,我們設定一個 Do 迴圈,逐行讀取檔案,直到沒有內容可讀取為止 (當 AtEdnOfStream 屬性為 TRUE)。使用 Readline 方法開始讀取檔案的第一行,然後將那行儲存在 strNextLine 變數中。現在開始變得有趣了。如稍早所說,FileSystemObject 不允許您搜尋檔案;因此,我們必須逐行讀取檔案,然後分別檢查每一行是不是您要的那行。下面的這行程式碼就是在作這個工作:
intLineFinder = InStr(strNextLine, "DisplayWelcomeDlg")
這個程式碼使用 InStr 方法來查看是否可在 strNextLine 變數中找到 DisplayWelcomeDlg 字串 (請記住,這個變數包含我們剛讀取的 .INI 行)。InStr 的作用是會報告找到目標字串所在的字元位置。例如,假設 strNextLine 等於下列:
xxxxxDisplayWelcomeDlgxxxxx
您可以看見,這個指令碼看起來比較短且清楚,也少了很多雙引號。那為什麼我們不建議您在 XP 或 Windows 2003 上使用這個指令碼?如果您想這麼作是可以的。不過,使用 Shell 物件擷取磁碟配額資訊有兩項限制。第一,Shell 物件指令碼只可針對本機電腦執行;和 WMI 指令碼不同的是,您無法連接到遠端機器並傳回磁碟配額資訊。第二,您一次只能擷取一台磁碟機的配額資訊。使用 WMI,您可以傳回包含電腦上所有磁碟機之磁碟配額資訊的集合。使用 Shell 物件,您將必須撰寫程式碼取得磁碟機 C: 的資料,然後撰寫程式碼取得磁碟機 D: 的資料,然後再寫程式碼取得磁碟機 E: 的資料等等。
intLineFinder = InStr(strNextLine, "DisplayUserInfoDlg")
您看懂了嗎?現在查看 .INI 檔的第一行,但那不是我們要的。那是要跳過,然後繼續嗎?不,不要跳過。我們要使用這行程式碼:
strNewFile = strNewFile & strNextLine & vbCrLf
這個程式碼會在記憶體中建立全新的 .INI 檔,並將新檔案儲存在 strNewFile 變數中。第一次執行迴圈時,strNewFile 會包含目前在 strNewFile (第一次執行時沒有任何內容) 中的所有內容、「加上」在 strNextLine 變數中的所有內容 ([OEM Install]),再「加上」歸位換行 (vbCrLf)。換句話說,重覆一次之後,strNewFile 看起來會像這樣:
[OEM Install]
很有趣,對吧?現在,我們進行迴圈然後讀取文字檔的第二行 (DisplayWelcomeDlg=YES)。猜猜看會如何?這次 InStr 找到目標字串,而 intLineFinder 變數會等於 1 (因為 DisplayWelcomeDlg 在第一個字元位置開始)。因為 intLineFinder 不等於 0,所以現在進入第一個 If-Then 區塊。在區塊中,只要變更 strNewLine 的值:
strNextLine = "DisplayWelcomeDlg=NO"
現在,變數中沒有從 .INI 檔讀入的文字;它現在包含了修改過的文字:
DisplayWelcomeDlg=NO
換句話說,我們並沒有真正編輯 DisplayWelcomeDlg 屬性的值。我們只是丟棄舊行,然後用全新的一行取代。不過,最後的結果跟我們直接編輯屬性值並沒有不同。進入到迴圈的尾端時,strNewFile 變數看起來會像這樣:
[OEM Install]
DisplayWelcomeDlg=NO
看到它的功用了嗎?我們會繼續逐行讀完 .INI 檔,同時逐行地建立 strNewFile 變數。在指令碼完成前,strNewFile 會包含此項資訊:
[OEM Install]
DisplayWelcomeDlg=NO
DisplayEULA=NO
DisplayTypeOfInstallDlg=NO
DisplaySelectDestDirDlg=YES
DisplayCustomDlg=NO
DisplayUserInfoDlg=NO
DisplayConfirmRegDlg=NO
DisplayStartCopyDlg=NO
DisplayFinishDlg=NO
DisplayFinalMessage=YES
DisplayRebootDlg=YES
ProgGroupName=
DefaultDestDir=
UserName=Ken Myer
UserCompanyName=
UserSerialNumber=
沒錯,這和我們在修改的 .INI 檔中想要的資訊完全相同。我們已經在往目標前進了。接下來關閉 sample.ini 檔,然後馬上重新開啟「寫入」(不是很高明的方法,但必須這麼做)。然後使用下列這行程式碼將 sample.ini 中的現有文字取代為儲存在 strNewFile 變數中的資訊:
objTextFile.WriteLine strNewFile
再次關閉檔案時,就會儲存資料,這就順利修改了 .INI 檔。 我們可不會說這是最好程式碼了;因為它不是。有些 .INI 檔可能無法使用這個功能。但是說實話,這可能是您能做到的最好狀況了,至少有工具內建在作業系統中。
如需詳細資訊
本文對您有任何幫助嗎?
需要更多程式碼範例
翻譯需要加強。
(剩餘 1500 個字元)
感謝您提供意見
頁面載入的速度夠快嗎?
您喜歡網頁的設計嗎?
表達更多意見→ SCRIPTING FRAMES
Scripting Frames
Frames are a special case in JavaScript — each frame behaving like the separate document that it is. This means that to modify anything in another frame, you first need to gain control of this frame by working with something called the frame tree.
This page was last updated on
As you probably know,
are a HTML technique which allow you to split one page into a number of contained windows, each of which hold a separate HTML file. While all of the component pages are displayed together they don't actually share any connections. A function executed in one will have no effect across in another. So we need to gain control of each frame through a part of the Document Object Model which assumes the place of the window level.
First, you'll need to make sure that all of your frames have been given a name attribute. They probably all will have one installed since it's necessary for , but just make sure. Something like this is fine:
&frame src="navigation.html" name="nav"&
&frame src="maincontent.html" name="content"&
When a frameset is loaded into the main window a frame tree is created. The window, which JavaScript calls top, holds some frames underneath it. If these frames have nested framesets inside themselves, then a further level is added to the tree. A page with frames set up as on the left will have a frame tree as on the right:
navcontent
Pretty simple, right? The top object has two elements, which are referenced by the name values you have given them previously. All you need to glean from this is each frame's position relative to the others. A more complex example would mean opening a new frameset inside an existing frame. Below we have something a bit more tricky, where the content frame has had three new frames opened inside it.
A bit more complex, that. As you can see, three new frames have been added on a new level underneath content, which retains its place in the tree, even though it isn't seen by the user.
To modify something in another frame you must first travel along the frame tree from the frame you're in to the frame you want to control. This involves some keywords.
Every frame has what's known as a parent frame — that is, the frame above it in the hierarchy. one's parent is content; nav's parent is top; and top's parent is top too (there aren't any more levels up, so it takes itself as a parent). To access a parent frame, we use just that:
From three, to get to top, we could write
parent.parent
Some frames also have children, predictably the frames held underneath them. Above, top has two children, nav and content; while content has itself three children. To access a child frame from its parent, we use
self.childName
We now have enough to move between frames This is all very similar to , if you're looking for an analogy. To get from three to nav, we'd write
parent.parent.nav
To go to three from top, we could write
self.content.three
The final method of addressing a frame is to start at the top and drill down to the frame you want. This is a useful shortcut if you're far down a complex tree and want to access a frame that's higher up. Simply start off with top and work down to the frame you want.
top.content.two
Now that you know the syntax, I can show you a real example. Say we were in the frame one, and we wanted to execute a
that's in nav. We traverse the frame tree, and then once we're in the right place we execute the code as if we're in the same document after that point. Think of the frames part of the following lines as equivalent to window. A function call might look like this (sending 6 as an arbitrary parameter):
parent.parent.nav.functionName(6);
Accessing variables and the rest is much the same:
parent.parent.nav.document.var = "Hooray";
And yeah, parent.parent could be replaced with top if you're smart. If you're having any trouble, Peter-Paul Koch has written a fine
which you can use to print out a diagram of your tree while you're working with it.
JavaScript is back! This is the best book on the subject I’ve ever read, showing you step-by-step the smartest ways to create usable, useful DHTML effects to enhance your site. SitePoint ships anywhere in the world and you can download the ..
Keep Learning // &
→ Go! Go!
Other JavaScript Articles // &&
Scripting Frames&&
What’s Related // &&
Love us? &
Add HTML Source to your bookmarks!
Add HTML Source to your bookmarks!
Printable pages &
Just print pages normally, our stylesheet will automatically reformat the page for you.
Translations &&
Translate automatically into:
Valid code, naturally &
We use (and teach!) only the finest
and , for your comfort and safety.
HTML Source is by me, Ross Shannon. I’m a web designer from Ireland, and am currently finishing my PhD in Computer Science.
You can support HTML Source by making a small donation.
Having fun? Getting lost? Got some comments?

我要回帖

更多关于 xd股票是什么意思 的文章

 

随机推荐