Exemplo n.º 1
0
        public Preprocessor(Triton.Common.IO.FileSystem fileSystem)
        {
            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            FileSystem = fileSystem;
        }
Exemplo n.º 2
0
 public static void Init(Triton.Common.ResourceManager resourceManager, Backend backend, Triton.Common.IO.FileSystem fileSystem)
 {
     resourceManager.AddResourceLoader<Texture>(new TextureLoader(backend, fileSystem));
     resourceManager.AddResourceLoader<ShaderProgram>(new ShaderLoader(backend, fileSystem));
     resourceManager.AddResourceLoader<Mesh>(new MeshLoader(backend, resourceManager, fileSystem));
     resourceManager.AddResourceLoader<SkeletalAnimation.Skeleton>(new SkeletonLoader(fileSystem));
     resourceManager.AddResourceLoader<Material>(new MaterialLoader(resourceManager, fileSystem));
     resourceManager.AddResourceLoader<BitmapFont>(new BitmapFontLoader(resourceManager, fileSystem));
 }
Exemplo n.º 3
0
        public GameObjectManager(Stage stage, InputManager inputManager, ResourceManager resourceManager, Triton.Physics.World physicsWorld, Graphics.Camera camera)
        {
            if (stage == null)
                throw new ArgumentNullException("stage");
            if (inputManager == null)
                throw new ArgumentNullException("inputManager");
            if (resourceManager == null)
                throw new ArgumentNullException("resourceManager");
            if (physicsWorld == null)
                throw new ArgumentNullException("physicsWorld");
            if (camera == null)
                throw new ArgumentNullException("camera");

            Stage = stage;
            InputManager = inputManager;
            ResourceManager = resourceManager;
            PhysicsWorld = physicsWorld;
            Camera = camera;
        }
        public string Execute(Triton.Controller.TransitionContext context)
        {
            string retEvent = Events.Error;

            try {

                ActionContract.Requires<NullReferenceException>(
                context.Request.Items[this.AccountItemNameIn] != null,
                "Could not retrieve the account from the request to save.");

                ActionContract.Requires<TypeMismatchException>(
                    context.Request.Items[this.AccountItemNameIn] is SearchResult<Account> || context.Request.Items[this.AccountItemNameIn] is Account,
                    "The account item was not of type SearchResult<Account> or Account.");

                ActionContract.Requires<ApplicationException>(
                    context.Request.Items[this.AccountItemNameIn] is Account || (context.Request.Items[this.AccountItemNameIn] is SearchResult<Account> && context.Request.GetItem<SearchResult<Account>>(this.AccountItemNameIn).Items.Length > 0),
                    "The account items collection did not contain any items.");

                StringBuilder builder = new StringBuilder("");

                foreach(Account account in context.Request.GetItem<SearchResult<Account>>(this.AccountItemNameIn).Items) {
                    builder = builder.Append(account.Id + ",");
                }

                if(builder.Length > 1) {
                    builder = builder.Remove(builder.Length-1, 1);
                }

                context.Request[this.AccountIdParamNameOut] = builder.ToString();

                retEvent = Events.Ok;

            } catch (Exception ex) {

                this.logger.Error("Error occured in Execute.", ex);

            }

            return retEvent;
        }
Exemplo n.º 5
0
    /*private void Explosion()
     * {
     *      Instantiate(Blood, PuntoExplosion.transform.position, Quaternion.identity);
     * }
     */

    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("hit " + other.gameObject);

        if (other.gameObject.CompareTag("Enemy"))
        {
            //
            //	Destroy(blood,2f);
            ID = other.GetComponent <Transform>();

            int monster = EncuentraID(ID);


            switch (monster)
            {
            case 1:
                if (other.gameObject.GetComponentInParent <Ogro>().saludEnemigo > 1)
                {
                    print("Ogro");
                    ogro = other.GetComponentInParent <Ogro>();
                    ogro.saludEnemigo -= 100f;
                    print("Enemigo hit, salud:" + ogro.saludEnemigo.ToString());
                    ogro.barra_Salud.fillAmount = ogro.saludEnemigo / 100f;
                }

                {
                    if (other.gameObject.GetComponentInParent <Ogro>().saludEnemigo <= 0)
                    {
                        Contador_Monedas.scoreValue += ogro.numMonedas;
                        //	this.GetComponent<SphereCollider>().enabled = false;
                        other.GetComponentInParent <NavMeshControl>().enabled = false;
                        other.GetComponentInParent <NavMeshAgent>().enabled   = false;
                        other.GetComponentInParent <Animator>().enabled       = false;

                        //Desactivo barra de salud
                        ogro.barra_Salud.enabled = false;
                        other.GetComponentInParent <DestroyRag>().isRagdoll = true;
                        Destroy(other.gameObject);
                        //Destroy(gameObject);
                    }
                }

                break;

            case 2:
                if (other.gameObject.GetComponentInParent <Esqueleto>().saludEnemigo > 1)
                {
                    print("Esqueleto");
                    Skeleton = other.GetComponentInParent <Esqueleto>();
                    Skeleton.saludEnemigo -= 100f;
                    print("Enemigo hit, salud:" + Skeleton.saludEnemigo.ToString());
                    Skeleton.barra_Salud.fillAmount = Skeleton.saludEnemigo / 100f;
                }

                {
                    if (other.gameObject.GetComponentInParent <Esqueleto>().saludEnemigo <= 0)
                    {
                        scoreValue += Skeleton.numMonedas;
                        //this.GetComponent<SphereCollider>().enabled = false;
                        other.GetComponentInParent <NavMeshControl>().enabled = false;
                        other.GetComponentInParent <NavMeshAgent>().enabled   = false;
                        other.GetComponentInParent <Animator>().enabled       = false;

                        //Desactivo barra de salud
                        Skeleton.barra_Salud.enabled = false;
                        other.GetComponentInParent <DestroyRag>().isRagdoll = true;
                        Destroy(other.gameObject);
                        //	Destroy(gameObject);
                    }
                }
                break;

            case 3:
                if (other.gameObject.GetComponentInParent <Cabra>().saludEnemigo > 1)
                {
                    print("Cabra");
                    cabra = other.GetComponentInParent <Cabra>();
                    cabra.saludEnemigo -= 100f;
                    print("Enemigo hit, salud:" + cabra.saludEnemigo.ToString());
                    cabra.barra_Salud.fillAmount = cabra.saludEnemigo / 100f;
                }

                {
                    if (other.gameObject.GetComponentInParent <Cabra>().saludEnemigo <= 0)
                    {
                        scoreValue += cabra.numMonedas;
                        //	this.GetComponent<SphereCollider>().enabled = false;
                        other.GetComponentInParent <NavMeshControl>().enabled = false;
                        other.GetComponentInParent <NavMeshAgent>().enabled   = false;
                        other.GetComponentInParent <Animator>().enabled       = false;

                        //Desactivo barra de salud
                        cabra.barra_Salud.enabled = false;
                        other.GetComponentInParent <DestroyRag>().isRagdoll = true;
                        Destroy(other.gameObject);
                        //Destroy(gameObject);
                    }
                }
                break;

            case 4:
                if (other.gameObject.GetComponentInParent <Triton>().saludEnemigo > 1)
                {
                    print("Triton");
                    triton = other.GetComponentInParent <Triton>();
                    triton.saludEnemigo -= 100f;
                    print("Enemigo hit, salud:" + triton.saludEnemigo.ToString());
                    triton.barra_Salud.fillAmount = triton.saludEnemigo / 100f;
                }

                {
                    if (other.gameObject.GetComponentInParent <Triton>().saludEnemigo <= 0)
                    {
                        scoreValue += triton.numMonedas;
                        //	this.GetComponent<SphereCollider>().enabled = false;
                        other.GetComponentInParent <NavMeshControl>().enabled = false;
                        other.GetComponentInParent <NavMeshAgent>().enabled   = false;
                        other.GetComponentInParent <Animator>().enabled       = false;

                        //Desactivo barra de salud
                        triton.barra_Salud.enabled = false;
                        other.GetComponentInParent <DestroyRag>().isRagdoll = true;
                        Destroy(other.gameObject);
                        //	Destroy(gameObject);
                    }
                }
                break;
            }
        }

        //E.numVidas--;
    }
Exemplo n.º 6
0
 public static void Init(Triton.Common.ResourceManager resourceManager, Triton.Common.IO.FileSystem fileSystem)
 {
     resourceManager.AddResourceLoader<Mesh>(new MeshLoader(resourceManager, fileSystem));
 }