Beispiel #1
0
        public static void BuildPrefab()
        {
            GameObject gameObject = SpriteBuilder.SpriteFromResource("BleakMod/Resources/winchester_hats/winchester_hat_right", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("Badaboom");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            WinchestersHat.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/winchester_hats/winchester_hat_left", tk2dSprite.Collection));
            WinchestersHat.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("BleakMod/Resources/winchester_hats/winchester_hat_back", tk2dSprite.Collection));
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            WinchestersHat.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(WinchestersHat.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            WinchestersHat.boomprefab = gameObject2;
        }
Beispiel #2
0
    void doXuLy(SpItem bt)
    {
        if (currentState == State.InGame1)
        {
            sp1 = bt;
            if (sp1.Trangthai == true)
            {
                sp1.Trangthai = false;
                currentState  = State.Click1;
                khocCuoi.SetSprite("nguoihoi");
                sprite1       = bt.GetComponent <tk2dSprite>();
                sprite1.color = new Color(1, 1, 0.5f, 1);

                gt1 = bt.Giatri;
                SoundManager.Instance.PlayAudioClick();
            }
        }
        else if (currentState == State.Click1)
        {
            if (bt.Trangthai == true)
            {
                bt.Trangthai = false;
                currentState = State.Click2;

                sprite2       = bt.GetComponent <tk2dSprite>();
                sprite2.color = new Color(1, 1, 0.5f, 1);

                gt2 = bt.Giatri;
                SoundManager.Instance.PlayAudioClick();
                StartCoroutine(WaitTimeXuLyBN(1f, bt));
            }
        }
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        //rigidbody.isKinematic = true;
        tk2dSprite sprite = GetComponent <tk2dSprite>();

        if (DropColor == DropColor.Red)
        {
            sprite.SetSprite(3);
        }
        if (DropColor == DropColor.Blue)
        {
            sprite.SetSprite(11);
        }
        if (DropColor == DropColor.Yellow)
        {
            sprite.SetSprite(14);
        }
        if (DropColor == DropColor.Green)
        {
            sprite.SetSprite(7);
        }
        if (DropColor == DropColor.White)
        {
            sprite.SetSprite(13);
        }
    }
Beispiel #4
0
        public static void BuildPrefab()
        {   //hatdoer
            GameObject gameObject = SpriteBuilder.SpriteFromResource("knifeJam/Resources/beard_collection/beard_right.png", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("beard");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            Beard.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("knifeJam/Resources/beard_collection/beard_left", tk2dSprite.Collection));
            Beard.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("knifeJam/Resources/beard_collection/beard_up", tk2dSprite.Collection));

            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            Beard.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(Beard.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Beard.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Beard.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");

            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            Beard.skullprefab = gameObject2;
        }
Beispiel #5
0
    void Start()
    {
        if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.DEFAULT_BG.ItemId))
        {
            sky.SetSprite(bkgdSpriteCollection, "newbg 1");
            tree.SetSprite(bkgdSpriteCollection, "treeland");
            canopy.SetSprite(bkgdSpriteCollection, "treetop");
            ray.SetSprite(bkgdSpriteCollection, "hugeray");
            bottom.SetSprite(bkgdSpriteCollection, "treeland_bottom");

            scoreBack.gameObject.SetActive(false);
            counterback.gameObject.SetActive(false);
        }
        if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.CBLOSSOM_BG.ItemId))
        {
            sky.SetSprite(bkgdSpriteCollection2, "bg_blossom");
            tree.SetSprite(bkgdSpriteCollection2, "tree_cherry");
            canopy.SetSprite(bkgdSpriteCollection2, "cherryblossombgtop");
            ray.SetSprite(bkgdSpriteCollection2, "hugeray2");
            bottom.SetSprite(bkgdSpriteCollection2, "tree_cherry_bottom");

            scoreBack.gameObject.SetActive(true);
            counterback.gameObject.SetActive(true);
        }
    }
        public static void BuildPrefab()
        {           //hatdoer
            GameObject gameObject = SpriteBuilder.SpriteFromResource("Knives/Resources/RageShield", null);

            gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(gameObject);
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
            GameObject gameObject2 = new GameObject("kinda a hat");
            tk2dSprite tk2dSprite  = gameObject2.AddComponent <tk2dSprite>();

            tk2dSprite.SetSprite(gameObject.GetComponent <tk2dBaseSprite>().Collection, gameObject.GetComponent <tk2dBaseSprite>().spriteId);
            Rage_shield.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("Knives/Resources/RageShield", tk2dSprite.Collection));
            Rage_shield.spriteIds.Add(SpriteBuilder.AddSpriteToCollection("Knives/Resources/RageShield", tk2dSprite.Collection));

            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            Rage_shield.spriteIds.Add(tk2dSprite.spriteId);
            gameObject2.SetActive(false);
            tk2dSprite.SetSprite(Rage_shield.spriteIds[0]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Rage_shield.spriteIds[1]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");
            tk2dSprite.SetSprite(Rage_shield.spriteIds[2]);
            tk2dSprite.GetCurrentSpriteDef().material.shader = ShaderCache.Acquire("Brave/PlayerShader");

            FakePrefab.MarkAsFakePrefab(gameObject2);
            UnityEngine.Object.DontDestroyOnLoad(gameObject2);
            Rage_shield.shieldprefab = gameObject2;
        }
Beispiel #7
0
    void KeyPressIsMovement()
    {
        float x = Input.GetAxisRaw("Horizontal");
        float y = Input.GetAxisRaw("Vertical");

        if (x != 0 || y != 0)
        {
            if (y > 0)
            {
                sprite.SetSprite(6);
                direction = PLAYERHEADING.Up;
            }
            else if (y < 0)
            {
                sprite.SetSprite(7);
                direction = PLAYERHEADING.Down;
            }
            else if (x < 0)
            {
                sprite.SetSprite(1);
                direction = PLAYERHEADING.Left;
            }
            else if (x > 0)
            {
                sprite.SetSprite(3);
                direction = PLAYERHEADING.Right;
            }
            rigidbody2D.velocity = new Vector2(x, y);
        }
    }
    public void XuatDaTa()
    {
        if (children.Count > 0)
        {
            PhepToan tmvi;
            int      chon = UnityEngine.Random.Range(0, children.Count);

            vtg = chon;

            tmvi   = new PhepToan(children[chon].Pheptoan, children[chon].Giatri, children[chon].mLoai);
            BangKq = children[chon];


            SpItemMonkey levelCreate = spPrefab.Spawn <SpItemMonkey>
                                       (
                new Vector3(-5f, -241f, 33),
                spPrefab.transform.rotation
                                       );
            levelCreate.Giatri   = tmvi.Ketqua;
            levelCreate.Pheptoan = "" + tmvi.Congthuc;

            levelCreate.setData(tmvi.Loai);
            BangSoSanh = levelCreate;
            BangSoSanh.gameObject.SetActive(true);
            currentState = State.InGame1;

            ConKhi.SetSprite("khihoi");
        }
    }
Beispiel #9
0
    void DoDemoTexturePacker(tk2dSpriteCollectionSize spriteCollectionSize)
    {
        if (GUILayout.Button("Import"))
        {
            DestroyData();

            // Create atlas
            spriteCollectionInstance = tk2dSpriteCollectionData.CreateFromTexturePacker(spriteCollectionSize, texturePackerExportFile.text, texturePackerTexture);

            GameObject go = new GameObject("sprite");
            go.transform.localPosition = new Vector3(-1, 0, 0);
            spriteInstance             = go.AddComponent <tk2dSprite>();
            spriteInstance.SetSprite(spriteCollectionInstance, "sun");

            go = new GameObject("sprite2");
            go.transform.parent        = spriteInstance.transform;
            go.transform.localPosition = new Vector3(2, 0, 0);
            tk2dSprite sprite = go.AddComponent <tk2dSprite>();
            sprite.SetSprite(spriteCollectionInstance, "2dtoolkit_logo");

            go = new GameObject("sprite3");
            go.transform.parent        = spriteInstance.transform;
            go.transform.localPosition = new Vector3(1, 1, 0);
            sprite = go.AddComponent <tk2dSprite>();
            sprite.SetSprite(spriteCollectionInstance, "button_up");

            go = new GameObject("sprite4");
            go.transform.parent        = spriteInstance.transform;
            go.transform.localPosition = new Vector3(1, -1, 0);
            sprite = go.AddComponent <tk2dSprite>();
            sprite.SetSprite(spriteCollectionInstance, "Rock");
        }
    }
Beispiel #10
0
    public void UpdateBoard(InfoStats.CLASS_TYPE class_name,
                            int level, int diamond, int fire, int gold,
                            float energy, float exp)
    {
        text_level.text   = level.ToString();
        text_diamond.text = diamond.ToString();
        text_fire.text    = fire.ToString();
        text_gold.text    = gold.ToString();

        pro_exp.Value    = exp;
        pro_energy.Value = energy;

        switch (class_name)
        {
        case InfoStats.CLASS_TYPE.PALADIN:
            avatar.SetSprite("beastmaster_ava");
            break;

        case InfoStats.CLASS_TYPE.ARCHER:
            avatar.SetSprite("gunner_ava");
            break;

        case InfoStats.CLASS_TYPE.ASSASSIN:
            avatar.SetSprite("sorceress_ava");
            break;
        }
    }
    // Update is called once per frame
    void Update()
    {
        bool start   = (Input.GetButtonDown("Start Button"));
        bool back    = (Input.GetButtonDown("Back Button"));
        bool AButton = (Input.GetButtonDown("A Button"));

        if (AButton && !showingCredits)
        {
            Application.LoadLevel(targetLevel);
        }
        else if (back && !showingCredits)
        {
            Application.Quit();
        }
        else if (back && showingCredits)
        {
            showingCredits = false;
            menuImage.SetSprite("home");
        }
        else if (start && !showingCredits)
        {
            showingCredits = true;
            menuImage.SetSprite("credits");
        }
    }
Beispiel #12
0
    //TODO: pass info stats parameter
    void FillClassInfoStats(CombatStats info)
    {
        float baseValue = ConstantValue.COMBAT_BASE_VALUE;

        UIAttack.Value  = info.Attack / baseValue;
        UIDefense.Value = info.Defend / baseValue;
        //UIBlock.Value = 1;
        UICritical.Value = info.Critical / baseValue;
        UIDodge.Value    = info.Dodge / baseValue;

        switch (mainClass)
        {
        case InfoStats.CLASS_TYPE.PALADIN:
            UIHeroName.SetSprite("Beast-Master");
            charSprite.SetSprite("beastmaster");
            break;

        case InfoStats.CLASS_TYPE.ARCHER:
            UIHeroName.SetSprite("Text_Gunner");
            charSprite.SetSprite("gunner");
            break;

        case InfoStats.CLASS_TYPE.ASSASSIN:
            UIHeroName.SetSprite("Text_Sorceress");
            charSprite.SetSprite("sorceress");
            break;
        }
    }
Beispiel #13
0
    public void SetDownload(bool b)
    {
        isDownloaded = b;
        if (b)
        {
            switch (DataUtils.difficult)
            {
            case SongInfo.DIFF_LEVEL.EASY:
                bg.SetSprite("歌名条简单");
                break;

            case SongInfo.DIFF_LEVEL.HARD:
                bg.SetSprite("歌名条困难");
                break;

            case SongInfo.DIFF_LEVEL.MID:
                bg.SetSprite("歌名条普通");
                break;
            }
        }
        else
        {
            bg.SetSprite("歌名条下载");
        }
        CheckBuy();
        if (isDownloaded)
        {
            if (isHover)
            {
                GetComponent <Animation>().Stop();
                GetComponent <Animation>().Play("SongCardZoomIn");
            }
        }
    }
Beispiel #14
0
    // Update is called once per frame
    void Update()
    {
        GameObject obj = GameObject.FindGameObjectWithTag(constant.TAG_PLAYER);

        if (obj == null)
        {
            return;
        }

        char_property pro = obj.GetComponent <char_property> ();
        //Debug.Log ("pro hp:" + pro.MaxHp + "," + pro.Hp);

        int totalHp = pro.MaxHp;

        if (mHps.Count > pro.MaxHp)
        {
            for (int i = mHps.Count - 1; i >= pro.MaxHp; --i)
            {
                GameObject hpObj = mHps[i];
                mHps.Remove(hpObj);
                Destroy(hpObj);
            }
        }
        else if (mHps.Count < pro.MaxHp)
        {
            int oldnum = mHps.Count;
            int num    = pro.MaxHp - mHps.Count;
            for (int i = 0; i < num; ++i)
            {
                Vector3 v = getPosition(i + oldnum);
                //GameObject hpObj = (GameObject)Instantiate(Resources.Load(hpPath),v,Quaternion.identity);
                GameObject prefab = Resources.Load <GameObject> (hpPath);
                GameObject hpObj  = Instantiate(prefab) as GameObject;

                hpObj.transform.parent        = this.gameObject.transform;
                hpObj.transform.localPosition = v;
                mHps.Add(hpObj);
            }
        }

        //Component charProperty = obj.GetComponent<"char_property">();
        //int hp = charProperty.getHp();

        int hp = pro.Hp;

        for (int i = 0; i < totalHp; ++i)
        {
            GameObject hpSprObj = mHps[i];             // GameObject.Find("hp_child" + (i+1));
            tk2dSprite spr      = hpSprObj.GetComponentInChildren <tk2dSprite>();
            if (i < hp)
            {
                spr.SetSprite(spr.GetSpriteIdByName("heart_full"));
            }
            else
            {
                spr.SetSprite(spr.GetSpriteIdByName("heart_empty"));
            }
        }
    }
Beispiel #15
0
        public static bool SpawnerMain_SpawnItemSprite(SpawnerMain __instance, InvItem item, tk2dSprite itemImage, Item newItem)
        {
            try { itemImage.SetSprite(__instance.gc.spawnerMain.itemSprites, item.spriteName); } catch { }
            Material mat = itemImage.CurrentSprite.material;

            itemImage.GetComponent <Renderer>().sharedMaterial = mat;
            try
            {
                if (!__instance.gc.serverPlayer)
                {
                    __instance.itemLightUp        = Instantiate(mat);
                    __instance.itemLightUp.shader = __instance.gc.lightUpShader;
                }
                newItem.objectSprite.sprH.GetComponent <Renderer>().sharedMaterial = mat;
                newItem.objectSprite.sprH.SetSprite(itemImage.spriteId);
            }
            catch
            {
                try
                {
                    try { newItem.objectSprite.GetComponent <Renderer>().sharedMaterial = mat; }
                    catch { Debug.LogError("Couldn't set highlight for item 1: " + newItem); }
                    try { newItem.objectSprite.spr.GetComponent <Renderer>().sharedMaterial = mat; }
                    catch { Debug.LogError("Couldn't set highlight for item 2: " + newItem); }
                    try { newItem.objectSprite.sprH.GetComponent <Renderer>().sharedMaterial = mat; }
                    catch { Debug.LogError("Couldn't set highlight for item 3: " + newItem); }
                    newItem.objectSprite.transform.Find("Highlight").GetComponent <tk2dSprite>().SetSprite(itemImage.spriteId);
                    Debug.LogError("SPAWNN");
                }
                catch
                {
                    Debug.LogError("Couldn't set highlight for item 4: " + newItem);
                }
            }
            if (item.invItemName == VanillaItems.Money)
            {
                if (item.invItemCount is 1)
                {
                    itemImage.SetSprite(itemImage.GetSpriteIdByName("MoneyA"));
                    item.shadowOffset = 6;
                }
                else if (item.invItemCount > 1 && item.invItemCount <= 5)
                {
                    itemImage.SetSprite(itemImage.GetSpriteIdByName("MoneyB"));
                    item.shadowOffset = 4;
                }
                else if (item.invItemCount > 5 && item.invItemCount < 10)
                {
                    itemImage.SetSprite(itemImage.GetSpriteIdByName("MoneyC"));
                    item.shadowOffset = 4;
                }
                else
                {
                    item.shadowOffset = 3;
                }
            }

            return(false);
        }
Beispiel #16
0
    private IEnumerator _mergeAnimation()
    {
        yield return(new WaitForSeconds(MOVE_TWEEN_DURATION));

        numberSprite.SetSprite(NUMBERS[_curNumber].ToString());
        bgSprite.color = COLORS[_curNumber];
        _sequence.Restart();
        mergedInTurn = false;
    }
Beispiel #17
0
 public void setData(int gt)
 {
     giatri = gt;
     if (gt > (GameController.instance.vuotqua + 1))
     {
         spiteLv.SetSprite("levellock");
         txtSp.SetActive(false);
         spiteRate.gameObject.SetActive(false);
         spiteLv.color = new Color(1, 1, 1, 1);
     }
     else
     {
         spiteRate.gameObject.SetActive(true);
         spiteLv.SetSprite("levelopen");
         txtSp.SetActive(true);
         txtMesh.text  = "" + gt;
         spiteLv.color = new Color(1, 1, 0, 1);
         if (gt == (GameController.instance.vuotqua + 1))
         {
             spiteRate.SetSprite("khongsao");
         }
         else
         {
             if (GameController.instance.mGrade == 1)
             {
                 if (int.Parse(GameController.instance.mangTong[gt - 1]) >= 260)
                 {
                     spiteRate.SetSprite("basao");
                 }
                 else if (int.Parse(GameController.instance.mangTong[gt - 1]) > 240)
                 {
                     spiteRate.SetSprite("haisao");
                 }
                 else
                 {
                     spiteRate.SetSprite("motsao");
                 }
             }
             else
             {
                 if (int.Parse(GameController.instance.mangTong[gt - 1]) >= 300)
                 {
                     spiteRate.SetSprite("basao");
                 }
                 else if (int.Parse(GameController.instance.mangTong[gt - 1]) > 280)
                 {
                     spiteRate.SetSprite("haisao");
                 }
                 else
                 {
                     spiteRate.SetSprite("motsao");
                 }
             }
         }
     }
 }
Beispiel #18
0
 public void In(bool isBlack = true)
 {
     setting.transform.localPosition = new Vector3(0, 0, 1);
     setting.color = Color.white;
     sprite.color  = setting.color;
     sprite.SetSprite(isBlack?"blackbg":"whitebg");
     GetComponent <Animation>().Stop();
     GetComponent <Animation>().Play("CameraFadeIn");
     Invoke("AnimComplete", 0.2f);
 }
Beispiel #19
0
 private void SetState()
 {
     if (isFirstButton)
     {
         m_Button.SetSprite(isDown ? m_Btn1Dwon : m_Btn1Up);
     }
     else
     {
         m_Button.SetSprite(isDown ? m_Btn2Down : m_Btn2Up);
     }
 }
Beispiel #20
0
 void updateSprite()
 {
     if (subMenu)
     {
         sprite.SetSprite(levelSelectImageNames[curButton]);
     }
     else
     {
         sprite.SetSprite(mainMenuImageNames[curButton]);
     }
 }
        protected override void OnTrigger(Vector2 damageDirection)
        {
            if (m_hasTriggered)
            {
                return;
            }
            m_hasTriggered = true;

            if (!gameObject.GetComponent <tk2dSprite>())
            {
                return;
            }
            if (aiActor)
            {
                aiActor.SetOutlines(false);
            }
            GameObject TossedSpriteVFX = new GameObject(gameObject.name + "Sprite Toss VFX")
            {
                layer = LayerMask.NameToLayer("Unoccluded")
            };
            tk2dSprite newSprite = TossedSpriteVFX.AddComponent <tk2dSprite>();

            if (!string.IsNullOrEmpty(specificSpriteName))
            {
                newSprite.SetSprite(sprite.Collection, specificSpriteName);
            }
            else
            {
                newSprite.SetSprite(sprite.Collection, gameObject.GetComponent <tk2dSprite>().spriteId);
            }
            newSprite.HeightOffGround = 4;
            TossedSpriteVFX.SetLayerRecursively(LayerMask.NameToLayer("Unoccluded"));
            TossedSpriteVFX.transform.position   = transform.position;
            TossedSpriteVFX.transform.localScale = transform.localScale;

            if (applyRotation)
            {
                TossedSpriteVFX.transform.rotation = transform.rotation;
            }
            newSprite.UpdateZDepth();

            ExpandTossVFX tossVFX = TossedSpriteVFX.AddComponent <ExpandTossVFX>();

            tossVFX.DoRotation     = applyRotation;
            tossVFX.MovementSpeed1 = PopupSpeed;
            tossVFX.MovementSpeed2 = DropSpeed;
            tossVFX.Init();

            if (isPowBlockDeath)
            {
                AkSoundEngine.PostEvent("Play_EX_PowBlock_EnemyDeath", TossedSpriteVFX);
            }
            sprite.renderer.enabled = false;
        }
Beispiel #22
0
    public bool onBadEffect;     // bad effect가 현재 켜져 있는지.

    public virtual void InitializeCustomer()
    {
        onFever                 = false;
        onBadEffect             = false;
        transform.localScale    = new Vector3(960f, 960f, 1f);
        transform.localPosition = new Vector3(-500f, 0f, 0f);
        customerHead.SetSprite(prefixName + "_face");
        speed = 130f;
        hp    = 100f;
        tapEffect.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
        GetComponent <Animation>().Play(GetCustomerType().ToString() + "_Idle");
    }
Beispiel #23
0
 void resetThongSo()
 {
     diemSo      = 0;
     demsai      = 0;
     sttQuestion = 0;
     mTime       = 1200;
     nguoi.SetSprite("nguoihoi");
     demframe = 0;
     nguoi.gameObject.transform.localPosition = po0;
     nguoi.scale = new Vector3(0.5f, 0.5f, 1);
     lstLevel.Clear();
 }
Beispiel #24
0
 public override void ChangeFaceBeforeExit(bool isSuccess)
 {
     base.ChangeFaceBeforeExit(isSuccess);
     if (isSuccess)
     {
         secondHead.SetSprite(secondPrefixName + "_faceT");
     }
     else
     {
         secondHead.SetSprite(secondPrefixName + "_faceF");
     }
 }
Beispiel #25
0
 /// <summary>
 /// Stand on a respawn point to activate it. You could play a particle effect of something here.
 /// </summary>
 override public void DoAction(RaycastCollider collider, RaycastCharacterController character)
 {
     if (RespawnPoint.currentRespawnPoint is RespawnFlag2DTK)
     {
         ((RespawnFlag2DTK)RespawnPoint.currentRespawnPoint).Down();
     }
     if (collider.direction == RC_Direction.DOWN)
     {
         RespawnPoint.currentRespawnPoint = this;
     }
     sprite.SetSprite(sprite.GetSpriteIdByName(flagUpSprite));
 }
    // Use this for initialization
    void Start()
    {
        btnContinute.OnClick += onClick_btnContinute;

        txtHoanThanh.text = ClsLanguage.doHoanThanhBaiThi();
        if (VioGameController.instance.tienganh)
        {
            titlemonkey.SetSprite("monkey");
        }
        else
        {
            titlemonkey.SetSprite("khithongminh");
        }
    }
    public void SetSelfHuPaiParameter(MaJiangHuPaiNotifySelfParameter param)
    {
        m_SelfName.text = PlayerInformation.Instance.PlayerID;
        bool isZiMo = this.IsBonusType(param.BounsTypes, BounsType.ZiMo);

        m_OtherName.text = isZiMo?  string.Format(StringConsts.GUANG_JIA, string.Join(StringConsts.SPACING, param.FangPaoPlayerIds.ToArray()), param.FangPaoPlayerIds.Count) : param.FangPaoPlayerIds[0];

        m_SelfIcon.SetSprite(isZiMo ? "Settlement_ZhiMo" : "Settlement_Hu");
        m_OtherIcon.gameObject.SetActive(!isZiMo);
        m_OtherIcon.SetSprite("Settlement_FangPao");
        m_SelftBonus.text = string.Empty;
        m_OtherBonus.text = string.Empty;
        m_Title.SetSprite(isZiMo ? "TitleZiMo" : "TitleHu");
    }
Beispiel #28
0
 // Use this for initialization
 void Start()
 {
     btnContinute.OnClick += btnContinute_OnClick;
     if (GameController.instance.tienganh != 1)
     {
         spTitle.SetSprite("monkey");
     }
     else
     {
         spTitle.SetSprite("khithongminh");
     }
     txtHoanThanh.text = ClsLanguage.doHoanThanhBaiThi();
     btnContinute.gameObject.transform.GetChild(0).GetComponent <tk2dTextMesh>().text = ClsLanguage.doContinute();
 }
Beispiel #29
0
    void Update()
    {
        string genderStr  = gender == Gender.MALE ? "man" : "woman";
        string clothesStr = clothing == Clothing.CASUAL ? "casual" : "suit";
        string skinStr    = skinColour == SkinColour.WHITE ? "white" : "black";
        string hairStr    = "red";

        switch (hairColour)
        {
        case HairColour.BLACK:
            hairStr = "black";
            break;

        case HairColour.BROWN:
            hairStr = "brown";
            break;

        case HairColour.BLONDE:
            hairStr = "blonde";
            break;

        case HairColour.GREY:
            hairStr = "grey";
            break;

        case HairColour.BALD:
            hairStr = "bald";
            break;
        }

        if (characterAnimator != null)
        {
            animationFrame = characterAnimator.animationFrame;
        }

        if (clothing == Clothing.ALIEN)
        {
            clothesSprite.SetSprite("alien/" + animationFrame);
            skinSprite.renderer.enabled = false;
            hairSprite.renderer.enabled = false;
        }
        else
        {
            clothesSprite.SetSprite(genderStr + " clothes " + clothesStr + "/" + animationFrame);
            skinSprite.SetSprite(genderStr + " skin " + skinStr + "/" + animationFrame);
            hairSprite.SetSprite(genderStr + " hair " + hairStr + "/" + animationFrame);
            skinSprite.renderer.enabled = true;
            hairSprite.renderer.enabled = true;
        }
    }
Beispiel #30
0
    // Use this for initialization
    void Start()
    {
        btnPlay.OnClick += onClick_btnPlay;
        if (VioGameController.instance.tienganh)
        {
            spTitle.SetSprite("monkey");
        }
        else
        {
            spTitle.SetSprite("khithongminh");
        }

        txtContent.text = ClsLanguage.doContentMoney();
    }
Beispiel #31
0
	void Awake()
	{
//		lineRenderer = GetComponent<LineRenderer>();
//		lineRenderer.useWorldSpace = false;
		sprite = GetComponent<tk2dSprite>();
		sprite.SetSprite( GestureTemplate.name );
		sprite.color = runeColor;
		OnCreate();
		wakeTime = Time.time;
	}
    // change the last full heart to empty
    public void DepleteHearts()
    {
        if (currentHearts > 0)
        {
            currentHearts--;

            for(int i = maxHearts; i > (currentHearts); i--)
            {
                heart = transform.FindChild("Heart"+i).GetComponent<tk2dSprite>();
                heart.SetSprite("HeartEmpty");
                heart.transform.localScale = new Vector3(2, 2, 1);
            }
        }
    }
    // change the last empty heart to full (health pickup)
    public void IncreaseHearts()
    {
        if (currentHearts < maxHearts)
        {
            currentHearts++;

            for(int i = 1; i <= currentHearts; i++)
            {
                heart = transform.FindChild("Heart"+i).GetComponent<tk2dSprite>();
                heart.SetSprite("HeartFull");
                if(i == currentHearts)
                {
                    heart.transform.localScale = new Vector3(2, 2, 1);
                }
            }
        }
    }
Beispiel #34
0
    // Use this for initialization
    void Start()
    {
        timeTravelAnimator =  this.transform.FindChild("Time Travel Animation").GetComponent<tk2dSpriteAnimator>();
        //timePeriodText =  this.transform.FindChild("Time Period Text").GetComponent<tk2dTextMesh>();
        timePeriodImage =  this.transform.FindChild("Time Period Image").GetComponent<tk2dSprite>();

        timeTravelAnimator.gameObject.SetActive(true);
        timeTravelAnimator.gameObject.SetActive(false);

        playingAnimation = false;

        if (LevelManager.IsFuture()) {
            //timePeriodText.text = "future";
            timePeriodImage.SetSprite("gui_future_text");
        }
        else {
            //timePeriodText.text = "past";
            timePeriodImage.SetSprite("gui_past_text");
        }

        //StartCoroutine("PlayTransitionAnimation");
    }
Beispiel #35
0
 // Use this for initialization
 void Start()
 {
     currentPageSprite = GetComponent<tk2dSprite>();
     currentPageSprite.SetSprite("gui_tutorial_screen_01");
 }
Beispiel #36
0
	public void Initialize(string spriteName){
		m_sprite = transform.GetChild(0).GetComponent<tk2dSprite>();
		m_sprite.SetSprite(spriteName);
		
		size = new Vector2(m_sprite.GetUntrimmedBounds().size.x, m_sprite.GetUntrimmedBounds().size.y); 
	}