コード例 #1
0
        public BorderCrate(Vector2 position, CrateType type) : base(position, "borderCrate", DrawManager.Layer.Playground)
        {
            Crate c = null;

            switch (type)
            {
            case CrateType.Apple:
                c = new AppleCrate(position);
                break;

            case CrateType.Random:
                c = new RandomCrate(position);
                break;

            case CrateType.Life:
                c = new LifeCrate(position);
                break;

            case CrateType.Aku:
                c = new AkuAkuCrate(position);
                break;

            case CrateType.Bounce_Apple:
                c = new AppleBounceCrate(position);
                break;

            case CrateType.Bounce_Wooden:
                c = new WoodenBounceCrate(position);
                break;

            case CrateType.Bounce_Iron:
                c = new IronBounceCrate(position);
                break;

            case CrateType.Iron:
                c = new IronCrate(position);
                break;

            case CrateType.Trigger_Iron:
                c = new TriggerIronCrate(position);
                break;

            case CrateType.Tnt:
                c = new TntCrate(position);
                break;

            case CrateType.Nitro:
                c = new NitroCrate(position);
                break;

            default:
                c = new IronCrate(position);
                break;
            }

            Crate = c;

            clipTriggered   = AudioManager.GetAudioClip("crateTriggered");
            crateTriggered  = false;
            timeToTriggered = TIME_TO_TRIGGER_CRATE;

            PhysicsManager.RemoveItem(RigidBody);
            RigidBody = null;
        }