My apologies, but the grammar in this tutorial is also pretty awful. There are a few run-on sentences, which I had to look over multiple times to understand what you meant (Example: “That is because Unity3d editor static function only work with Unity basic type not any created by us.” Upon further inspection, I realized you were saying Unity3D’s static functions only works with basic types, nothing custom.) The first thing you could do to improve this helpful tutorial is to take some time to proofread. I personally find it an intellectual turn off to read something I have to decipher - you may or may not know it (and I think you do know it, definently better than I), but it dosen’t look like you know it if you do a bad job of explaining it. Again, no offense intended.
On the subject of a bad job of explaining a process, though, this tutorial in truth dosen’t do a good job of explaining a lot at all, and I am a programmer. What I gather from reading this is: We’re creating an Editor folder, and copying that script you supplied. We need to have a WorldSpawnPoint component (is it a script? Is it a so-named object? What is this “WorldSpawnPoint” you have contrived?) You then tell us to watch what we make the WorldSpawnPoint point to, because it could point to theoretically anything, then tell us to write a second, uncommented script.
What I gather this script does (comments describe what I see in this):
// Declare script variables. I am
// Unsure why these have to be public
// variables - these are only used to
// "spawn" (read: copy) our spawnable
// object.
public var ActorPrefab:String = "Aki";
public var IsMainActor:boolean = false;
// Function that will be run when the scene is started...
function Start()
{
// Create an instance of our "ActorPrefab".
var actor:GameObject = GameObject.Instantiate(Resources.Load(ActorPrefab, GameObject));
// If we did not create an instance, log the error!
if(actor == null)
{
Debug.LogError("World Spawn Point could not instantiate actor : " + ActorPrefab);
}
else
// Place our copy at the spawn point's location.
// For nonprogrammers, a bit of inference: this
// script is added to our spawn point GameObject,
// and inherits our spawn point object's location
// and rotation.
{
actor.transform.position = transform.position;
actor.transform.rotation = transform.rotation;
if(IsMainActor)
{
// Do something with this actor. Like what,
// exactly? Register it to a manager? Ok.
// what else do we do with main actors?
// Some explanation outside of the code of
// things this if block could do would prove
// helpful.
}
}
}
Your supplied script is a simple, textbook spawn point. We take a resource, copy it, put it at the spawn point’s location and give it the spawn point’s rotation so it’s facing the default direction.
…And the tutorial ends there, with naught more than a farewell. If you intended to write something helpful, please take no offense from my criticisms, but go back and clarify your process! If you were simply showing off what you were doing, why did you bother writing this “tutorial?” A video or webplayer demo would have sufficed, in that case.
I apologize if any of what I have expressed in this post seems overly harsh, but I think you have a little revising to consider. Your tutorial is at least a start, and could potentially be most helpful! I wish you luck on your project.