Пример #1
0
 public EnumRenderer getRendererByEnum(RendererEnum rEnum)
 {
     if (!enumRendererMapping.ContainsKey(rEnum))
     {
         return(null);
     }
     return(enumRendererMapping[rEnum]);
 }
Пример #2
0
    void OnCollisionEnter(Collision collision)
    {
        ContactPoint contact = collision.contacts[0];

        //Debug.Log("ObjectAutoMove-->OnCollisionEnter" + contact.normal);
        //Debug.DrawRay(contact.point, contact.normal, Color.red, 500);
        if (collision.collider.tag == TagEnum.Head.ToString())
        {
            if (!ReferenceEquals(collision.collider.transform.parent, null) && collision.collider.transform.parent.tag == TagEnum.Player.ToString())
            {
                if (contact.normal.y > 0)
                {
                    if (currentType == RendererEnum.Solid)
                    {
                        oMeidia.playAudio(AudioEnum.Bump);
                    }
                    else if (currentType == RendererEnum.Breakable)
                    {
                        oMeidia.playAudio(AudioEnum.BlockBreak);
                    }
                    else if (currentType == RendererEnum.Bounce)
                    {
                        oMeidia.playAudio(AudioEnum.Bump);
                        oMeidia.playAnimation(AnimationEnum.Bumped, true);
                        if (amount <= 1)
                        {
                            currentType = nextType;
                        }
                        else
                        {
                            amount--;
                        }
                    }
                    else if (currentType == RendererEnum.Question)
                    {
                        Transform transform = iManager.instantiate(InstantiationEnum.Hp);
                        pRise.setTarget(transform);
                        pRise.defaultAutoMove();
                        oMeidia.playAudio(AudioEnum.Bump);
                        oMeidia.playAnimation(AnimationEnum.Bumped, true);
                        currentType = nextType;
                    }
                }
            }
        }
    }
Пример #3
0
 public EnumRenderer getRendererByEnum(RendererEnum rEnum)
 {
     return(rendererMapping.getRendererByEnum(rEnum));
 }