Ejemplo n.º 1
0
        // init functions as well as a check to see if we're staring out as the player
        protected virtual void Start()
        {
            anim = GetComponent <Animator>();
            //if(Camera.main.GetComponent<CameraMoveToPoint>() != null)
            //{
            //    camChange = Camera.main.GetComponent<CameraMoveToPoint>();

            //}

            camChange = Camera.main.GetComponent <CameraMoveToPoint>();


            // store name tag color
            nameTagStartColor = nameTagColor;

            // required
            if (!InitRenderers())
            {
                Debug.Log(name + "(Actor) could not initialize Renderers.");
                return;
            }
            // required
            if (!InitPhysics())
            {
                Debug.Log(name + "(Actor) could not initialize Physics.");
                return;
            }
            // optional
            if (!InitNameTag())
            {
                Debug.Log(name + "(Actor) does not have TextMesh, OK...");
            }
            // optional
            if (!InitAnimation())
            {
                Debug.Log(name + "(Actor) does not have Animation, OK...");
            }

            // register for attachment notification
            User.Instance.onPlayerAttached += OnPlayerAttached;

            // if we're starting out as player -- only one actor should start as player!
            if (player)
            {
                User.Instance.Player = this;
            }
        }
Ejemplo n.º 2
0
 //////////////////////////////////////////////////////////////
 // Init
 //////////////////////////////////////////////////////////////
 protected virtual void Awake()
 {
     Instance  = this;
     camChange = GetComponent <CameraMoveToPoint>();
 }