Exemplo n.º 1
0
        //////////////////////////////////////////////////////////////////////////////////
        // MonoBehaviour
        //

        /// <summary>
        /// get references to services and internal components.
        /// </summary>
        void Awake() {

            // get services
            controller = IOC.Resolve<IShipController>();
            bullets = IOC.Resolve<IShootableFactory>();
            registry = IOC.Resolve<IRegistryService>();

            // get and initialize components
            rigid = GetComponent<Rigidbody>();
            rigid.constraints = RigidbodyConstraints.FreezeRotation;
            rigid.useGravity = false;

            // register with services and controllers
            controller.Register(this);
            registry.Register<IShip>("Ship", this);
        }