void FireProjectile() { PackedSprite FluffSprite = (PackedSprite)(gameObject.transform.parent.GetComponent("PackedSprite")); FluffSprite.PlayAnim(8); // Create projectile and Update UI if (--numberOfProjectiles >= 0) { //Update the UI , update the current avialable number of projectiles on HUD projectileCounterText.text = numberOfProjectiles.ToString() + "/" + projectileFullnumbers.ToString(); staticNumberOfProjectiles = numberOfProjectiles; NewProjectile = (GameObject)Instantiate(projectile, initpos, Quaternion.identity); //GameObject.FindGameObjectWithTag("FluffProjCollider").active = false; Vector3 dir = currtpos - initpos; dir.Normalize(); NewProjectile.rigidbody.velocity = dir * projectileSpeed; } GameObject.FindGameObjectWithTag("FluffProjCollider").active = false; fluffclicked = false; //Play projctileClip SoundManScript.Scene_Source.clip = SoundManScript.projctileClip; SoundManScript.Scene_Source.Play(); }
// Use this for initialization void Start() { startTime = Time.time; sprites = GetComponent <PackedSprite>(); audio.clip = soundEffect; audio.Play(); }
/// <summary> /// Simple nine-slice constructor, all corners and sides are mirrored and rotated /// </summary> /// <param name="topLeftCorner">Top left corner PackedSprite</param> /// <param name="topSide">Top side PackedSprite</param> /// <param name="middle">Middle PackedSprite</param> public NineSlice(PackedSprite topLeftCorner, PackedSprite topSide, PackedSprite middle) { TopLeftCornerID = topLeftCorner.id; TopSideID = topSide.id; TopRightCornerID = topLeftCorner.id; LeftSideID = topSide.id; MiddleID = middle.id; RightSideID = topSide.id; BottomLeftCornerID = topLeftCorner.id; BottomSideID = topSide.id; BottomRightCornerID = topLeftCorner.id; FlagsTopLeftCorner = 0; FlagsTopSide = 0; FlagsTopRightCorner = RB.FLIP_H; FlagsLeftSide = RB.ROT_90_CCW; FlagsRightSide = RB.ROT_90_CW; FlagsBottomLeftCorner = RB.FLIP_V; FlagsBottomSide = RB.FLIP_V; FlagsBottomRightCorner = RB.FLIP_H | RB.FLIP_V; TopLeftCornerRect = Rect2i.zero; TopSideRect = Rect2i.zero; TopRightCornerRect = Rect2i.zero; LeftSideRect = Rect2i.zero; MiddleRect = Rect2i.zero; RightSideRect = Rect2i.zero; BottomLeftCornerRect = Rect2i.zero; BottomSideRect = Rect2i.zero; BottomRightCornerRect = Rect2i.zero; IsRectBased = false; }
protected override void OnTriggerEnter(Collider other) { base.OnTriggerEnter(other); if (other.gameObject.CompareTag(TagMaskDefine.GFAN_ACTOR)) { DropData tDropData = ItemDataManager.Instance.CopyDropData; if (tDropData != null) { tDropData.PickupItemList.Add(chestID); } NetSender.Instance.RequestRandomCopyChest(chestID); PackedSprite chestAnim = GetComponentInChildren <PackedSprite>() as PackedSprite; if (null != chestAnim) { chestAnim.PlayAnim(1); // Unseal a chest animation // chestAnim.PlayAnim("OpenBaoxiang"); float animLen = chestAnim.GetCurAnim().GetLength(); StartCoroutine(DoWaitForSeconds(animLen + 0.2f, delegate() { Status2DCopy status2DCopy = (Status2DCopy)GameStatusManager.Instance.MCopyStatus; if (null != status2DCopy && null != status2DCopy.StageCopy) { status2DCopy.StageCopy.DestroyChest(gameObject); } })); } } }
// Use this for initialization void Start() { startTime = Time.time; sprites = GetComponent<PackedSprite>(); audio.clip = soundEffect; audio.Play(); }
// BY LSJ // port vie or port defense inspire and order buffer void CreateBuffIcon(EBufferType type, int row, int col) { GameObject go = GameObject.Instantiate(BuffIconTp) as GameObject; go.name = type.ToString(); go.transform.parent = _mBuffInfoRoot; go.transform.localScale = Vector3.one; float x = (_mBuffIconWidth - -5) * col - 0.5f * _mBuffIconWidth; float y = -(_mBuffIconHeight + 5) * row - 0.5f * _mBuffIconHeight; go.transform.localPosition = new Vector3(x, y, -1f); UIButton btn = go.GetComponent <UIButton>() as UIButton; UIEventListener.Get(btn.gameObject).onPress += OnClickBuffIcon; btn.Data = type; PackedSprite icon = btn.transform.Find("Icon").GetComponent <PackedSprite>() as PackedSprite; string iconName = string.Empty; switch (type) { case EBufferType.BUFFER_INSPIRE: iconName = "Buf9901"; break; case EBufferType.BUFFER_ORDER: iconName = "Buf9801"; break; } icon.PlayAnim(iconName); }
public RoleScrollStruct(Transform parent, PackedSprite avatarSprite, PackedSprite roleSpriteBG, PackedSprite roleSpriteBG2, int panelIndex) { this.avatarSprite = avatarSprite; this.roleSpriteBG = roleSpriteBG; this.roleSpriteBG2 = roleSpriteBG2; //init the touch input _fingerTouch = new FingerTouch(this); _singleScroll = new SingleScrollPanel[] { // new SingleScrollPanel(parent,this,0,"role1100001000"), // new SingleScrollPanel(parent,this,1,"role1100002000"), // new SingleScrollPanel(parent,this,2,"role1100003000"), // new SingleScrollPanel(parent,this,3,"role1100004000"), // new SingleScrollPanel(parent,this,4,"role1100005000") new SingleScrollPanel(parent, this, 0, "BigAvatarMan1"), new SingleScrollPanel(parent, this, 1, "BigAvatarMan2"), new SingleScrollPanel(parent, this, 2, "BigAvatarMan3"), // new SingleScrollPanel(parent,this,3,"BigAvatarMan4"), // new SingleScrollPanel(parent,this,4,"BigAvatarMan5") }; RoleNameSelect = "BigAvatarMan" + (MaxRoleCnt * 0.5f + 1).ToString(); // RoleNameSelect = "BigAvatarMan3"; }
public override void Initial() { coolDownSprite = gameObject.GetComponentInChildren <PackedSprite>(); if (coolDownSprite == null) { UnityEngine.Object cooldown = UIWindowMng.Instance.GetObjFromCommon("Cooldown"); if (cooldown != null) { GameObject cooldownGo = UnityEngine.Object.Instantiate(cooldown, Vector3.zero, new Quaternion(0, 0, 0, 0)) as GameObject; cooldownGo.transform.parent = gameObject.transform; cooldownGo.transform.localPosition = new Vector3(0, 0, -0.1f); coolDownSprite = cooldownGo.GetComponent <PackedSprite>(); } else { LogManager.LogError("Can not found Cooldown Prefab."); return; } } coolDownSprite.SetAnimCompleteDelegate(AnimEndDelegate); coolDownSprite.RenderCamera = UISystem.Instance.UiCamrea; if (ezButton != null) { ezButton.AddInputDelegate(DragDelegate); } CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_SHORTKEY, ShortKeyClick); ClearAction(); }
/// <summary> /// Equality /// </summary> /// <remarks> /// Equality check. /// </remarks> /// <param name="other">Other</param> /// <returns>True if equal</returns> public override bool Equals(object other) { if (other == null) { return(false); } if (other is PackedSprite) { PackedSprite sprite = (PackedSprite)other; if (id == sprite.id && Size == sprite.Size && SourceRect == sprite.SourceRect && TrimOffset == sprite.TrimOffset) { return(true); } return(false); } else { return(false); } }
public void ShootExplodingHandler(object shellInstance) { GameObject shellInst = (GameObject)shellInstance; PackedSprite shellSprite = shellInst.GetComponentInChildren <PackedSprite> (); shellSprite.PlayAnim("Explode"); //Shitcode if (tag == "Enemy") { AudioManager.Play("RocketmanMissleExplosion"); } else if (tag == "Alias") { AudioManager.Play("WaspMissleExplosion"); } iTween.ShakePosition(Camera.mainCamera.gameObject, Vector3.forward * 0.05f, 0.5f); Destroy(shellInst, 1f); foreach (var o in Physics.OverlapSphere(shellInst.transform.position, explosionRange)) { if (o.tag == tag) { o.GetComponent <Unit> ().Hit(damage); } } }
private void ShowGeneralQualityStar(int quality) { int highStarCount = quality / 2; int halfPos = quality % 2; if (halfPos == 0) { halfPos = -1; } else { halfPos = quality / 2; } int index = 0; foreach (GameObject go in _mQualityStarList.Keys) { PackedSprite star = go.GetComponent <PackedSprite>() as PackedSprite; if (index < highStarCount) { star.PlayAnim("Star"); } else if (index == halfPos) { star.PlayAnim("HalfStar"); } else { star.PlayAnim("GrayStar"); } index++; } }
public Image(Vector2i pos, PackedSprite sprite, int align = RB.ALIGN_H_LEFT | RB.ALIGN_V_CENTER) { this.sprite = sprite; size = sprite.Size; alpha = 255; tintColor = Color.white; SetPosition(originalPos = pos, alignment = align); }
void Awake() { PackedSprite packedSprite = gameObject.GetComponent <PackedSprite>(); if (packedSprite != null) { packedSprite.RenderCamera = UISystem.Instance.UiCamrea; } }
public void setIconQiangHuaVisible(bool visible) { int testLeng = QianghuaIcons.GetLength(0); for (int i = 0; i < QianghuaIcons.GetLength(0); i++) { PackedSprite packeQianghua = QianghuaIcons[i]; packeQianghua.transform.localScale = Vector3.zero; } }
void Awake() { transform.localScale = Vector3.one; if (null == nameText) { nameText = transform.Find("NPCName").GetComponent <SpriteText>() as SpriteText; avatar = transform.Find("NPCIcon").GetComponent <PackedSprite>() as PackedSprite; } }
// Use this for initialization protected void Awake() { sm_instance = this; // background m_fadeBackground = GetComponent <PackedSprite>(); // hide the background first m_fadeBackground.transform.localScale = Vector3.one; }
void OnDestroy() { if (mAvatar != null) { Destroy(mAvatar); mAvatar = null; } smWarshipList.Remove(this); }
private void CreateBattleButtons() { // set up die buttons UpdateDieButtons(); pawnCards = new Dictionary <Pawn, UIObj>(); EnemyPawnCard epc = new EnemyPawnCard(new Vector2i(size.x / 2, 72), new Vector2i(128, 128), battle.enemy, battle, RB.ALIGN_H_CENTER | RB.ALIGN_V_CENTER); AddUIObj(epc); pawnCards.Add(battle.enemy, epc); viewPawnImages = new Image[battle.allies.Length + 1]; string[] tabNames = new string[battle.allies.Length]; int spellCount = 0; PlayerPawnCard ppc; PackedSprite viewSprite = RB.PackedSpriteGet("Eye", Game.SPRITEPACK_BATTLE); for (int i = 0; i < battle.allies.Length; i++) { AddUIObj(ppc = new PlayerPawnCard(new Vector2i(8, 8 + 36 * i), new Vector2i(96, 32), battle.allies[i], battle)); pawnCards.Add(battle.allies[i], ppc); AddUIObj(viewPawnImages[i] = new Image(new Vector2i(108, 24 + 36 * i), viewSprite)); if (i > 0) { viewPawnImages[i].isVisible = false; } int x = i; ppc.SetOnClick(() => { ViewSpellTab(x); }); tabNames[i] = battle.allies[i].GetName(); spellCount += battle.allies[i].GetSpells().Length; } spellPane = new TabbedPane(new Vector2i(size.width - 102, 0), new Vector2i(102, size.height), true); spellPane.SetTabs(tabNames); AddUIObj(spellPane); spellButtons = new SpellButton[spellCount]; spellButtonOwnership = new int[spellCount]; int currentSpellIndex = 0; for (int i = 0; i < battle.allies.Length; i++) { currentSpellIndex = FillSpellPane(spellPane, i, currentSpellIndex); } /* * Spell[] knownSpells = battle.GetClientPawn().GetSpells(); * spellButtons = new SpellButton[knownSpells.Length]; * for(int i = 0; i < knownSpells.Length; i++) { * AddUIObj(spellButtons[i] = new SpellButton(battle, knownSpells[i], new Vector2i(size.width - 100, 8 + i * 36))); * }*/ ViewSpellTab(0); }
public void PlayAttackNumber(EffectType type, string animationName, string animationStr, int val) { delay = AttackNumAnimPosDelayTime; duration = AttackNumAnimPosDurationTime; val = Mathf.Abs(val); int length = val.ToString().Length + 1; // Scale 0.5f float scaleFactor = 1.0f; if (type == EffectType.NUMBER_GREEN || type == EffectType.NUMBER_GRAY) { scaleFactor = 0.5f; } float singleWidth = numberPreb.width; singleWidth *= scaleFactor; float width = length * singleWidth; if (!animationName.Equals("GreenPlus")) { PackedSprite number = GameObject.Instantiate(numberPreb) as PackedSprite; number.width *= scaleFactor; number.height *= scaleFactor; number.transform.parent = _gobjCrit.transform; number.transform.localPosition = new Vector3(-width / 2, 0, 0); number.transform.localScale = Vector3.one; number.SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_LEFT); number.PlayAnim(animationName); FadeSpriteAlpha.Do(number, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj); AnimatePosition.Do(_gobjCrit.gameObject, EZAnimation.ANIM_MODE.To, _gobjCrit.transform.localPosition + new Vector3(0, AttackNumRiseUpHeight, 0), EZAnimation.linear, duration, delay, null, DestroyEffectObj); } for (int i = 0; i < length - 1; i++) { int currNum = val / (int)Mathf.Pow(10, length - 2 - i) % 10; PackedSprite number2 = GameObject.Instantiate(numberPreb) as PackedSprite; number2.width *= scaleFactor; number2.height *= scaleFactor; number2.transform.parent = _gobjCrit.transform; number2.transform.localPosition = new Vector3(-width / 2 + singleWidth * (i + 1), 0, 0); number2.transform.localScale = Vector3.one; number2.SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_LEFT); number2.PlayAnim(animationStr + currNum); FadeSpriteAlpha.Do(number2, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, null); AnimatePosition.Do(_gobjCrit.gameObject, EZAnimation.ANIM_MODE.To, _gobjCrit.transform.localPosition + new Vector3(0, AttackNumRiseUpHeight, 0), EZAnimation.linear, duration, delay, null, DestroyEffectObj); } }
/// <summary> /// Sets the change attrbute. /// </summary> /// <param name='value'> /// Value. Show Value /// </param> /// <param name='pos'> /// Position. /// </param> /// <param name='space'> /// Space. /// </param> public void SetChangeAttrbute(int value = 0, float pos = 0, float space = 10) { if (value == 0) { if (mChangeValueText != null) { Destroy(mChangeValueText.gameObject); mChangeValueText = null; } } else { if (ChangeValueText != null && mChangeValueText == null) { mChangeValueText = Instantiate(ChangeValueText) as SpriteText; if (mChangeValueText == null) { return; } Transform tPackedTran = mChangeValueText.transform.Find("Icon"); PackedSprite tPackedSprite = tPackedTran.GetComponent <PackedSprite>(); string color = GUIFontColor.White255255255; if (value > 0) { color = GUIFontColor.LimeGreen089210000; tPackedSprite.PlayAnim(0); } else if (value < 0) { color = GUIFontColor.DarkRed210000005; tPackedSprite.PlayAnim(1); value = -value; } mChangeValueText.SetCharacterSize(mAttributeText.characterSize); mChangeValueText.Text = color + value; mChangeValueText.transform.parent = transform; mChangeValueText.transform.localScale = Vector3.one; if (pos == 0) { mChangeValueText.transform.localPosition = new Vector3(mAttributeText.transform.localPosition.x + mAttributeText.PixelSize.x + space, mAttributeText.transform.localPosition.y, mAttributeText.transform.localPosition.z); tPackedSprite.transform.localPosition = new Vector3(tPackedSprite.transform.localPosition.x + mChangeValueText.PixelSize.x + space, tPackedSprite.transform.localPosition.y, tPackedSprite.transform.localPosition.z); } else { mChangeValueText.transform.localPosition = new Vector3(mAttributeText.transform.localPosition.x + pos, mAttributeText.transform.localPosition.y, mAttributeText.transform.localPosition.z); tPackedSprite.transform.localPosition = new Vector3(tPackedSprite.transform.localPosition.x + space, tPackedSprite.transform.localPosition.y, tPackedSprite.transform.localPosition.z); } } } }
//construct for battle effect font public BattleEffectFont(Transform parent, PackedSprite effectFont, SpriteText textSkill, PackedSprite number, Vector3 position, Vector3 offset, EffectType type, int val, string skillName) { // _mainCamera = Globals.Instance.MSceneManager.mMainCamera; // _uICamera = Globals.Instance.MGUIManager.MGUICamera; this.effectFontPreb = effectFont; this.textSkillPreb = textSkill; this.numberPreb = number; this.ReleaseEffect(parent, position, type, val, skillName, offset); }
public IEnumerator changeSkill30EftState3(PackedSprite skill30Eft2Ps) { int count = 5; int currnetCount = 0; while(currnetCount != count) { skill30Eft2Ps.transform.localScale += new Vector3(0.1f, 0.1f, 0); skill30Eft2Ps.renderer.material.color -= new Color32(0, 0, 0, 44); currnetCount++; yield return new WaitForSeconds(0.08f); } Destroy(skill30Eft2Ps.gameObject); }
// Use this for initialization void Awake() { mAvatar = (PackedSprite)Instantiate(AvatarPrefab); mAvatar.transform.parent = AvatarParent; mAvatar.transform.localPosition = Vector3.zero; mAvatar.transform.localScale = Vector3.one; mSelfPackedSprite = GetComponent <PackedSprite>(); transform.parent = Globals.Instance.MGUIManager.MGUICamera.transform; transform.localPosition = new Vector3(-1000, GeneralCmdPosY, GUIManager.GUI_NEAREST_Z + 10); }
void OnWizardCreate() { if (useNewMaterial) { if (newMaterialName != "") { material = new Material(Shader.Find("Sprite/Vertex Colored, Fast")); AssetDatabase.CreateAsset(material, "Assets/" + newMaterialName + ".mat"); } else { Debug.Log("Don't have new material name."); } } Object[] o = Selection.GetFiltered(typeof(Texture), SelectionMode.Unfiltered); for (int i = 0; i < o.Length; i++) { textures.Add((Texture)o[i]); } foreach (Texture texture in textures) { GameObject obj = new GameObject(texture.name); if (type == GUIType.PackedSprite) { PackedSprite tmp = obj.AddComponent <PackedSprite>(); tmp.gameObject.renderer.material = material; tmp.staticTexPath = AssetDatabase.GetAssetPath(texture); tmp.staticTexGUID = AssetDatabase.AssetPathToGUID(tmp.staticTexPath); Vector2 pxSize = tmp.GetDefaultPixelSize(AssetDatabase.GUIDToAssetPath, AssetDatabase.LoadAssetAtPath); tmp.width = pxSize.x; tmp.height = pxSize.y; } else if (type == GUIType.UIButton) { UIButton tmp = obj.AddComponent <UIButton>(); tmp.gameObject.renderer.material = material; } } BuildAtlases.doSpecificMaterials = true; List <Material> l = new List <Material>(); l.Add(material); BuildAtlases.targetMaterials = l; ScriptableWizard.DisplayWizard("Build Atlas", typeof(BuildAtlases)); }
void OnParticleCollision(GameObject col) { //Debug.Log(col.tag); if (col.CompareTag("CatapultPlant")) { // Gettign Packed Sprite of CatapultPlant game object plantPackedSprite = (PackedSprite)(col.transform.parent.GetComponent("PackedSprite")); catapultPlantTransform = col.transform.parent.gameObject.transform; if (!plantPackedSprite.IsAnimating()) { soundMangScript.Scene_Source.clip = soundMangScript.CatapultPlantSneezeClip; soundMangScript.Scene_Source.Play(); DeactiveColliders(); StartCoroutine(playShootingAnimation(plantPackedSprite.GetAnim("Sleeping").GetLength())); } } }
void InitOneRandomChest(Transform tf, int chestId) { tf.gameObject.SetActiveRecursively(true); UIButton btn = (UIButton)tf.GetComponent(typeof(UIButton)); //btn.SetInputDelegate(OnScreenBtnInputDel); PackedSprite anim = tf.GetComponentInChildren <PackedSprite>() as PackedSprite; if (null != anim) { anim.PlayAnim(0); // Default chest appearance } ChestTrigger trigger = tf.gameObject.AddComponent <ChestTrigger>() as ChestTrigger; trigger.ChestID = chestId; trigger.BoxSize = new Vector3(anim.width, anim.height, 1.0f); }
void Awake() { mIconSprite = GetComponentInChildren <PackedSprite>(); mAttributeText = GetComponentInChildren <SpriteText>(); mBoxCollider = gameObject.GetComponent <BoxCollider>(); if (mBoxCollider == null) { mBoxCollider = gameObject.AddComponent <BoxCollider>(); } if (Application.isPlaying && WordConfigValue != 0 && Globals.Instance.MDataTableManager != null) { AttributeName = Globals.Instance.MDataTableManager.GetWordText(WordConfigValue); } AttributeNameMirror = AttributeName; mMirrorAttrType = AttriType; }
/// <summary> /// Constructor /// </summary> /// <param name="topLeftCorner">Top left corner PackedSprite</param> /// <param name="topSide">Top side PackedSprite</param> /// <param name="topRightCorner">Top right corner PackedSprite</param> /// <param name="leftSide">Left side PackedSprite</param> /// <param name="middle">Middle PackedSprite</param> /// <param name="rightSide">Right side PackedSprite</param> /// <param name="bottomLeftCorner">Bottom left corner PackedSprite</param> /// <param name="bottomSide">Bottom side PackedSprite</param> /// <param name="bottomRightCorner">Bottom right corner PackedSprite</param> public NineSlice( PackedSprite topLeftCorner, PackedSprite topSide, PackedSprite topRightCorner, PackedSprite leftSide, PackedSprite middle, PackedSprite rightSide, PackedSprite bottomLeftCorner, PackedSprite bottomSide, PackedSprite bottomRightCorner) { TopLeftCornerID = topLeftCorner.id; TopSideID = topSide.id; TopRightCornerID = topRightCorner.id; LeftSideID = leftSide.id; MiddleID = middle.id; RightSideID = rightSide.id; BottomLeftCornerID = bottomLeftCorner.id; BottomSideID = bottomSide.id; BottomRightCornerID = bottomRightCorner.id; FlagsTopLeftCorner = 0; FlagsTopSide = 0; FlagsTopRightCorner = 0; FlagsLeftSide = 0; FlagsRightSide = 0; FlagsBottomLeftCorner = 0; FlagsBottomSide = 0; FlagsBottomRightCorner = 0; TopLeftCornerRect = Rect2i.zero; TopSideRect = Rect2i.zero; TopRightCornerRect = Rect2i.zero; LeftSideRect = Rect2i.zero; MiddleRect = Rect2i.zero; RightSideRect = Rect2i.zero; BottomLeftCornerRect = Rect2i.zero; BottomSideRect = Rect2i.zero; BottomRightCornerRect = Rect2i.zero; IsRectBased = false; }
public void Start() { smokeEftGameObject = Instantiate(smokeEftPrb) as GameObject; smokeEftGameObject.transform.parent = transform; smokeEftGameObject.transform.localPosition = new Vector3(0, 1.07f, 0); attackEftGameObject = Instantiate(attackEftPrb) as GameObject; attackEftGameObject.transform.parent = transform; attackEftGameObject.transform.localPosition = new Vector3(0, 0.8f, 0); attackEftGameObject.SetActive(false); smokeEftPackedSprite = smokeEftGameObject.GetComponent<PackedSprite>(); smokeEftPackedSprite.PlayAnim(0); attackEftPackedSprite = attackEftGameObject.GetComponent<PackedSprite>(); attackEftPackedSprite.SetAnimCompleteDelegate(atkFinish); }
public IEnumerator changeSkill30EftState1(PackedSprite skill30Eft1Ps, PackedSprite skill30Eft2Ps) { int count = 5; int currnetCount = 0; while(currnetCount != count) { skill30Eft1Ps.transform.localScale -= new Vector3(0.2f, 0.1f, 0); skill30Eft1Ps.renderer.material.color += new Color32(0, 0, 0, 44); skill30Eft2Ps.transform.localScale += new Vector3(0.2f, 0.1f, 0); currnetCount++; yield return new WaitForSeconds(0.08f); } skill30Eft1Ps.transform.localScale = new Vector3(1.0f, 0.5f, 0); skill30Eft1Ps.renderer.material.color = new Color32(255, 0, 0, 255); skill30Eft2Ps.transform.localScale = new Vector3(1.0f, 0.5f, 0); // skill30Eft1Ps.PlayAnim(0); StartCoroutine(changeSkill30EftState2(skill30Eft1Ps, skill30Eft2Ps)); }
public void LoadSpriteEffect(string spriteEffectCode) { if (gameLevelItemAsset != null) { GameObject go = GameDraggableEditor.LoadSpriteEffect( gameLevelItemObject, gameLevelItemAsset.destroy_effect_code, Vector3.one.WithX(3).WithY(3).WithZ(3) * .1f); if (go != null) { PackedSprite sprite = go.GetComponent <PackedSprite>(); if (sprite != null) { sprite.PlayAnim(0); } go.transform.parent = gameLevelItemObject.transform; } } }
void OnCollisionEnter(Collision col) { // FireBall hit the Bush only once if (col.gameObject.CompareTag("Bush") && once) { once = false; bushGameObject = col.gameObject.transform.parent.gameObject; // Burn the Bush and create the flame ParticalSystem . flameobj = (GameObject)Instantiate(flame, bushGameObject.transform.position, Quaternion.identity); fadeout = true; gameObject.collider.isTrigger = true; renderer.enabled = false; gameObject.tag = null; bushSprite = (PackedSprite)bushGameObject.GetComponent("PackedSprite"); Destroy(col.gameObject); } // if the collider is anything else "PopcornFruit" ,"Bush" ,"ActualPsys" then just fade it out with its reaction. else if (col.gameObject.tag != "PopcornFruit" && col.gameObject.tag != "Bush" && col.gameObject.tag != "ActualPsys") { GameObject ReactionFireball = (GameObject)Instantiate(reactionPsys, transform.position, Quaternion.identity); gameObject.collider.isTrigger = true; renderer.enabled = false; gameObject.tag = null; Destroy(ReactionFireball, delayTimeReactionPsys); } else if (col.gameObject.tag == "BabyFluff") { soundManScript.Scene_Source.clip = soundManScript.BabyFluffHitClip; soundManScript.Scene_Source.Play(); //Debug.Log("baby"); Destroy(gameObject); if (BabyFluff.PlayDefaultAnimation) { PackedSprite mypackedsprite = (PackedSprite)(col.transform.parent.gameObject.GetComponent("PackedSprite")); mypackedsprite.PlayAnim(4); } } }
void OnCollisionEnter(Collision c) { Target t = c.gameObject.GetComponent <Target>(); if (t != null) { PackedSprite ps = hpGameObject.GetComponent <PackedSprite>(); GameStatus.Inst.HP -= t.missPunish; ps.PlayAnim(GameStatus.Inst.HP < 0? 0:GameStatus.Inst.HP); } Target r = c.gameObject.GetComponent <Target>(); if (r != null) { r.recycle(); } else { Destroy(c.gameObject); } }
private void Init(UISlider progressBlood, float val, Vector3 position, Vector3 offset) { _bloodStrip = GameObject.Instantiate(progressBlood) as UISlider; _bloodStrip.gameObject.transform.parent = Globals.Instance.M3DItemManager.EZ3DItemParent; _bloodStrip.gameObject.transform.localScale = Vector3.one; // tzz added // for Reinforcements label sign WarshipL warship = Globals.Instance.MPlayerManager.GetWarship(_shipID); if (null != warship) { if (warship.Property.WarshipIsAttacker && warship.Property.WarshipIsNpc) { PackedSprite ps = (PackedSprite)GameObject.Instantiate(Globals.Instance.M3DItemManager.ReinforcementsLabelPrefab); ps.transform.parent = _bloodStrip.gameObject.transform; } } UpdateBloodStripValue(val, position, offset); }
// Use this for initialization void Start() { sprites = GetComponent<PackedSprite>(); }
public void Awake() { self = GetComponent<PackedSprite>(); }
void Start() { sprites = GetComponentInChildren<PackedSprite>(); PlayerInstance= this; }
/// <summary> /// Add a MOD(3rd party) application to the Application Launcher. Use ApplicationLauncherButton.VisibleInScenes to set where the button should be displayed. /// </summary> /// <remarks> /// Note that the application launcher is destroyed when the player exits to the main menu. If the player then /// loads up a new save the application launcher will be recreated and you will have to re-add your button. /// Register for GameEvents.onGUIApplicationLauncherDestroyed and GameEvents.onGUIApplicationLauncherReady /// to detect when the application launcher has been destroyed and when it has been re-created. /// </remarks> /// <param name="onTrue">Callback for when the button is toggeled on</param> /// <param name="onFalse">Callback for when the button is toggeled off</param> /// <param name="onHover">Callback for when the mouse is hovering over the button</param> /// <param name="onHoverOut">Callback for when the mouse hoveris off the button</param> /// <param name="onEnable">Callback for when the button is shown or enabled by the application launcher</param> /// <param name="onDisable">Callback for when the button is hidden or disabled by the application launcher</param> /// <param name="visibleInScenes">The "scenes" this button will be visible in. For example VisibleInScenes = ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW;</param> /// <param name="sprite">The 38x38 PackedSprite animation to use for the button icon. Use ApplicationLauncherButton.PlayAnim() to play the animation.</param> /// <returns></returns> public extern ApplicationLauncherButton AddModApplication(RUIToggleButton.OnTrue onTrue, RUIToggleButton.OnFalse onFalse, RUIToggleButton.OnHover onHover, RUIToggleButton.OnHoverOut onHoverOut, RUIToggleButton.OnEnable onEnable, RUIToggleButton.OnDisable onDisable, ApplicationLauncher.AppScenes visibleInScenes, PackedSprite sprite);
void Start() { player = GameObject.FindGameObjectWithTag("Player"); ignoreCollisionWithEnemies(); curHP = maxHP; teleportPoints = GameObject.FindGameObjectsWithTag("TeleportPoint").ToList(); instancedMob = new List<GameObject>(); for(int i = 0; i < teleportPoints.Count; i++) { if(teleportPoints[i].name == "Teleport Point - Center") teleportPoint_central = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Right 1") teleportPoint_right1 = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Left 1") teleportPoint_left1 = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Right 2") teleportPoint_right2 = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Left 2") teleportPoint_left2 = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Floor Right Center") teleportPoint_right_center = teleportPoints[i]; if(teleportPoints[i].name == "Teleport Point - Floor Left Center") teleportPoint_left_center = teleportPoints[i]; } List<PackedSprite> spritesSet = GetComponentsInChildren<PackedSprite>().ToList(); for(int i = 0; i < spritesSet.Count; i++) { if(spritesSet[i].name == "Skill Curse") skillCurse = spritesSet[i]; if(spritesSet[i].name == "Skill LifeDrain") skillLifeDrain = spritesSet[i]; if(spritesSet[i].name == "More Skill Cast 1") moreSkillsSprite = spritesSet[i]; } spritesSet = player.GetComponentsInChildren<PackedSprite>().ToList(); for(int i = 0; i < spritesSet.Count; i++) { if(spritesSet[i].name == "Skill LifeDrain") skillLifeDrainPlayer = spritesSet[i]; } curTeleportCooldown = teleportCooldown/2; curSummonCooldown = summonCooldown/2; curCurseCooldown = curseCooldown/2; curIcicleCooldown = icicleCooldown/2; curBlameCooldown = blameCooldown/2; curLifeDrainCooldown = lifeDrainCooldown/2; Instantiate(summonSmoke, transform.position, transform.rotation); }