//之前不存在,则返回真
 public bool addBubble(Transform pTransform, GameObject pBubblePrefab, out zzGUIBubbleComputeRect lBubble)
 {
     lBubble = getBubble(pTransform);
     if(!lBubble)
     {
         var lBubbleObject = (GameObject)Object.Instantiate(pBubblePrefab);
         lBubbleObject.transform.parent = transform;
         lBubble = lBubbleObject.GetComponent<zzGUIBubbleComputeRect>();
         lBubble.bubblePosition = pTransform;
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 void bloodValueChanged(Life pLife)
 {
     if (pLife.bloodValue < lastBloodValue
         && GameScene.Singleton.playerInfo.race == race)
     {
         if (!bubble)
         {
             if (attackedSound)
                 zzBackgroudAudioPlayer.Singleton.play(attackedSound);
             bubble = createBubble(attackedBubblePrefab);
             ((zzGUIBubbleLayout)bubble.bubbleLayout)
                 .showTime = warningTimeLength;
         }
         ((zzGUIBubbleLayout)bubble.bubbleLayout)
             .timePostion = 0f;
     }
     lastBloodValue = pLife.bloodValue;
 }
Ejemplo n.º 3
0
    void destroyed(Life pLife)
    {
        if (GameScene.Singleton.playerInfo.race != race)
            return;
        if(bubble)
        {
            GameObject.Destroy(bubble.gameObject);
        }
        if (destroyedSound)
            zzBackgroudAudioPlayer.Singleton.play(destroyedSound);

        bubble = bubbleMessage.addBubble(destroyedBubblePrefab);
        bubble.transform.position = bubblePosition.position;
        bubble.bubblePosition = bubble.transform;
        ((zzGUIBubbleLayout)bubble.bubbleLayout).showTime = warningTimeLength;
    }