private bool InsertReference(ElementReference reference, int referenceType)
        {
            int counter = count(reference);
            ElementReferenceDataControl erdc = new ElementReferenceDataControl(sceneDataControl, reference, referenceType, counter);
            bool hasLayer = reference.getLayer() >= 0;

            insertInOrder(new ElementContainer(erdc, -1, null), (reference.getLayer() >= 0));
            return(hasLayer);
        }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        updateResource();
        if (current_resource != null)
        {
            string path = current_resource.getAssetPath(NPC.RESOURCE_TYPE_STAND_UP);

            //current_anim = Loader.loadAnimation(AssetsController.InputStreamCreatorEditor.getInputStreamCreator (path),path,new EditorImageLoader());
            current_anim = new eAnim(path);

            this.gameObject.name = player.getId();

            current_frame = 0;

            // ## ANIMATION METHOD ##

            /*Texture2D tmp = current_anim.getFrame(0).getImage(false,false,0).texture;
             * update_ratio = current_anim.getFrame(0).getTime();//Duration/1000f;*/

            // ## EANIM METHOD ##
            Texture2D tmp = current_anim.frames [0].Image;
            update_ratio = current_anim.frames [0].Duration / 1000f;
            this.GetComponent <Renderer> ().material.mainTexture = tmp;
            this.transform.localScale = new Vector3(tmp.width / 10, tmp.height / 10, 1) * context.getScale();
        }


        Vector2 tmppos = new Vector2(context.getX(), context.getY()) / 10 + (new Vector2(0, -transform.localScale.y)) / 2;

        transform.localPosition = new Vector3(tmppos.x, 60 - tmppos.y, -context.getLayer());
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        foreach (ResourcesUni ar in ad.getResources())
        {
            if (ConditionChecker.check(ar.getConditions()))
            {
                Texture2DHolder th  = new Texture2DHolder(ar.getAssetPath(Atrezzo.RESOURCE_TYPE_IMAGE));
                Texture2D       tmp = th.Texture;
                this.GetComponent <Renderer> ().material.mainTexture = tmp;
                this.transform.localScale = new Vector3(tmp.width / 10, tmp.height / 10, 1) * context.getScale();

                Vector2 tmppos = new Vector2(context.getX(), context.getY()) / 10 + (new Vector2(0, -transform.localScale.y)) / 2;
                transform.localPosition = new Vector3(tmppos.x, 60 - tmppos.y, -context.getLayer());
                break;
            }
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        foreach (ResourcesUni cr in od.getResources())
        {
            if (ConditionChecker.check(cr.getConditions()))
            {
                current_resource = cr;
                string    path = cr.getAssetPath(Item.RESOURCE_TYPE_IMAGE);
                Texture2D th   = ResourceManager.Instance.getImage(path);

                this.GetComponent <Renderer> ().material.mainTexture = th;
                this.transform.localScale = new Vector3(th.width / 10, th.height / 10, 1) * context.getScale();
                break;
            }
        }

        this.gameObject.name = od.getId();

        Vector2 tmppos = new Vector2(context.getX(), context.getY()) / 10 + (new Vector2(0, -transform.localScale.y)) / 2;

        transform.localPosition = new Vector3(tmppos.x, 60 - tmppos.y, -context.getLayer());

        hasOverSprite = current_resource.getAssetPath(Item.RESOURCE_TYPE_IMAGEOVER) != null;
    }
Exemplo n.º 5
0
        protected void Positionate()
        {
            Vector2 tmppos = new Vector2(context.getX(), context.getY()) / DIVISOR + (new Vector2(0, -transform.localScale.y)) / 2;

            transform.localPosition = new Vector3(tmppos.x, HEIGHT - tmppos.y, -context.getLayer() + deformation);
        }